|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface IoCComponentProviderFactory
An IoC component provider factory. An implementaton of such a class may be used to support integration with Inversion of Control frameworks such as Spring and Guice.
An instance of IoCComponentProviderFactory may be registered with a Client or WebApplication instance on contruction and initialization respectively.
When a component, a resource class or provider class, needs to be managed
the runtime will defer to the registered IoCComponentProviderFactory instance
to obtain a IoCComponentProvider
from which a component instance,
of the resource class or provider class, can be obtained.
If the component is not supported then a null value may be returned and the
runtime will manage the component.
Specializations of IoCComponentProvider
must be returned by the
getComponentProvider
methods that declare the boundary of
responsibility, between the runtime and the underlying IoC framework,
for management of a component.
If an instance of IoCManagedComponentProvider
is returned then
the component is fully managed by the underlying IoC framework, which
includes managing the construction, injection and destruction according
to the life-cycle declared in the IoC framework's semantics.
If an instance of IoCInstantiatedComponentProvider
is returned then
the component is instantiated and injected by the underlying IoC framework,
but the life-cycle is managed by the runtime according to the life-cycle
declared in the runtime's semantics.
If an instance of IoCProxiedComponentProvider
is returned then the
component is fully managed by the runtime but when an instance is created
the underlying IoC framework is deferred to for creating a proxy of the
component instance.
Method Summary | |
---|---|
IoCComponentProvider |
getComponentProvider(java.lang.Class<?> c)
Get the IoC component provider for a class. |
IoCComponentProvider |
getComponentProvider(ComponentContext cc,
java.lang.Class<?> c)
Get the IoC component provider for a class with additional context. |
Method Detail |
---|
IoCComponentProvider getComponentProvider(java.lang.Class<?> c)
getComponentProvider
in interface ComponentProviderFactory<IoCComponentProvider>
c
- the class
IoCComponentProvider getComponentProvider(ComponentContext cc, java.lang.Class<?> c)
The additional context will be associated with the annotations and
optionally an annotated object. For example, a component provider may
be requested for a class that is the type of a Field
, or be
requested for a class that is the type of a method parameter.
cc
- the component context to obtain annotations and
the annotated object (if present).c
- the class
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |