|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
public interface Provider<T>
Similar to the Factory contract, providing a means to access the
class type instance. The scope of the instances produces by the provider
is determined by the implementation (e.g., singleton, per lookup, etc).
Bindings represent something that is registered in Services whereas a Provider provides the runtime services for the given
registered Binding entry in the correct context appropriate for
the caller.
ManagedComponentProvider| Method Summary | ||
|---|---|---|
T |
get()
The system calls this method to obtain a reference to the component/service. |
|
Collection<Annotation> |
getAnnotations()
The collection of annotations for this type. |
|
|
getByType(Class<U> type)
Obtain a reference to the associated component/service. |
|
boolean |
isActive()
Returns true if the component has been instantiated. |
|
Class<? extends T> |
type()
The class type of the implementation. |
|
| Method Detail |
|---|
T get()
throws ComponentException
ComponentException - If the factory failed to get/create an instance
and would like to propagate the error to the caller.<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 this provider failed to get or
create an instance of the componentClass<? extends T> type()
Factory actually
produces.
Note that there is some cost to this call during the first
invocation since it needs to perform classloading. Care
should therefore be exercised accordingly.
Collection<Annotation> getAnnotations()
type().
boolean isActive()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||