|
eXo Kernel :: Container 2.5.0-Alpha2 | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
public interface Container
This interface defines all the methods that we need to implement in order to allow eXo Kernel to delegate the whole life cycle of the components. An implementation needs to be able to:
| Method Summary | ||
|---|---|---|
void |
accept(ContainerVisitor visitor)
Accepts a visitor that should visit the child containers, component adapters and component instances. |
|
|
createComponent(Class<T> clazz,
InitParams params)
Creates a component corresponding to the given Class with the
given InitParams |
|
|
getComponentAdapter(Object componentKey,
Class<T> bindType)
Find a component adapter associated with the specified key. |
|
|
getComponentAdapterOfType(Class<T> componentType)
Find a component adapter associated with the specified type. |
|
Collection<ComponentAdapter<?>> |
getComponentAdapters()
Retrieve all the component adapters inside this container. |
|
|
getComponentAdaptersOfType(Class<T> componentType)
Retrieve all component adapters inside this container that are associated with the specified type. |
|
|
getComponentInstance(Object componentKey,
Class<T> bindType)
Retrieve a component instance registered with a specific key. |
|
|
getComponentInstanceOfType(Class<T> componentType)
Find a component instance matching the specified type. |
|
|
getComponentInstancesOfType(Class<T> componentType)
Returns a List of components of a certain componentType. |
|
ManagementContext |
getManagementContext()
Gives the corresponding ManagementContext |
|
MBeanServer |
getMBeanServer()
Provides the MBeanServer this method is needed for backward compatibility |
|
ObjectName |
getScopingObjectName()
Gives the ObjectName of the container build from the scoping data |
|
Interceptor |
getSuccessor()
Retrieve the successor of this container in the chain of Interceptor. |
|
void |
initialize()
Initializes the container |
|
|
registerComponentImplementation(Object componentKey,
Class<T> componentImplementation)
Register a component. |
|
|
registerComponentInstance(Object componentKey,
T componentInstance)
Register an arbitrary object as a component in the container. |
|
ComponentAdapter<?> |
unregisterComponent(Object componentKey)
Unregister a component by key. |
|
| Methods inherited from interface org.picocontainer.Startable |
|---|
start, stop |
| Methods inherited from interface org.picocontainer.Disposable |
|---|
dispose |
| Method Detail |
|---|
<T> T getComponentInstance(Object componentKey,
Class<T> bindType)
componentKey - the key that the component was registered with.bindType - the expected type of the instance if one can be found.
null if no component has been registered for the specified
key.<T> T getComponentInstanceOfType(Class<T> componentType)
componentType - the type of the component.
Interceptor getSuccessor()
Interceptor.
Interceptor instance, or null if this container does not have a successor.
<T> ComponentAdapter<T> getComponentAdapter(Object componentKey,
Class<T> bindType)
componentKey - the key that the component was registered with.bindType - the expected raw type of the adapter if one can be found.
null if no component has been registered
for the specified key.<T> ComponentAdapter<T> getComponentAdapterOfType(Class<T> componentType)
componentType - the type of the component.
null if no component has been
registered for the specified key.Collection<ComponentAdapter<?>> getComponentAdapters()
ComponentAdapters inside this container. The collection will
not be modifiable.a variant of this method which returns the component adapters inside this
container that are associated with the specified type.<T> List<ComponentAdapter<T>> getComponentAdaptersOfType(Class<T> componentType)
componentType - the type of the components.
ComponentAdapters inside this container that are associated with
the specified type. Changes to this collection will not be reflected in the container itself.
<T> List<T> getComponentInstancesOfType(Class<T> componentType)
throws ContainerException
componentType - the searched type.
ContainerExceptionvoid accept(ContainerVisitor visitor)
visitor - the visitor
<T> ComponentAdapter<T> registerComponentImplementation(Object componentKey,
Class<T> componentImplementation)
throws ContainerException
componentKey - a key that identifies the component. Must be unique within the container. The type
of the key object has no semantic significance unless explicitly specified in the
documentation of the implementing container.componentImplementation - the component's implementation class. This must be a concrete class (ie, a
class that can be instantiated).
getXXX() methods of the
Container interface can be used to retrieve a reference to the component later on.
ContainerExceptio - if registration of the component fails.
ContainerException
<T> ComponentAdapter<T> registerComponentInstance(Object componentKey,
T componentInstance)
throws ContainerException
componentKey - a key that identifies the component. Must be unique within the container. The type of the
key object has no semantic significance unless explicitly specified in the implementing
container.componentInstance - an arbitrary object.
getXXX() methods of the
Container interface can be used to retrieve a reference to the component later on.
ContainerException - if registration fails.ComponentAdapter<?> unregisterComponent(Object componentKey)
componentKey - key of the component to unregister.
ManagementContext getManagementContext()
ManagementContext
MBeanServer getMBeanServer()
MBeanServer this method is needed for backward compatibility
ObjectName getScopingObjectName()
<T> T createComponent(Class<T> clazz,
InitParams params)
throws Exception
Class with the
given InitParams
clazz - the Class of the object to createparams - the parameters to use to create the component
Exception - if any issue occurs while creating the component.void initialize()
|
eXo Kernel :: Container 2.5.0-Alpha2 | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||