|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
public interface Providers<T>
This contract provides a means to access runtime component providers.
This is often times produced byContractLocator and ServiceLocator.
| Method Summary | ||
|---|---|---|
Collection<Provider<T>> |
all()
Return all applicable Providers. |
|
T |
get()
A shortcut for |
|
|
getByType(Class<U> type)
Obtain a reference to the component/service from the associated provider. |
|
Provider<T> |
getProvider()
Return the "best" Provider from the collection that matches
current criteria. |
|
| Method Detail |
|---|
Collection<Provider<T>> all()
Providers. Will always
be a non-null return value.
Provider<T> getProvider()
Provider from the collection that matches
current criteria. If the collection all() is not empty,
this will return a non null value. Otherwise the return value is
null.
Currently "best" is reserved for future use.
T get()
if (getProvider() != null)
return getProvider().get();
return null;
<U> U getByType(Class<U> type)
type - the required type of the returned object
ClassCastException - if the component is not an instance of
the given type
ComponentException - if the associated provider failed to
get or create an instance of the component
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||