public class CachingContainer extends AbstractInterceptor
holder, parentdelegate| Constructor and Description |
|---|
CachingContainer() |
| Modifier and Type | Method and Description |
|---|---|
<T> ComponentAdapter<T> |
getComponentAdapterOfType(Class<T> componentType,
boolean autoRegistration)
Find a component adapter associated with the specified type.
|
<T> List<ComponentAdapter<T>> |
getComponentAdaptersOfType(Class<T> componentType)
Retrieve all component adapters inside this container that are associated with the specified type.
|
<T> T |
getComponentInstance(Object componentKey,
Class<T> bindType,
boolean autoRegistration)
Retrieve a component instance registered with a specific key.
|
<T> T |
getComponentInstanceOfType(Class<T> componentType,
boolean autoRegistration)
Find a component instance matching the specified type.
|
<T> List<T> |
getComponentInstancesOfType(Class<T> componentType)
Returns a List of components of a certain componentType.
|
String |
getId()
Gives an identifier to the Container, allowing to inject an
Interceptor into the Interceptor
chain. |
<T> ComponentAdapter<T> |
registerComponentImplementation(Object componentKey,
Class<T> componentImplementation)
Register a component.
|
<T> ComponentAdapter<T> |
registerComponentInstance(Object componentKey,
T componentInstance)
Register an arbitrary object as a component in the container.
|
ComponentAdapter<?> |
unregisterComponent(Object componentKey)
Unregister a component by key.
|
setHolder, setParent, setSuccessoraccept, createComponent, dispose, getComponentAdapter, getComponentAdapters, getManagementContext, getMBeanServer, getScopingObjectName, getSuccessor, initialize, start, stopclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitaccept, createComponent, getComponentAdapter, getComponentAdapters, getManagementContext, getMBeanServer, getScopingObjectName, getSuccessor, initializedisposepublic <T> ComponentAdapter<T> getComponentAdapterOfType(Class<T> componentType, boolean autoRegistration)
AbstractContainergetComponentAdapterOfType in interface ContainergetComponentAdapterOfType in class AbstractContainercomponentType - the type of the component.autoRegistration - indicates whether the auto registration should be performed or notnull if no component has been
registered for the specified key.public <T> List<ComponentAdapter<T>> getComponentAdaptersOfType(Class<T> componentType)
AbstractContainergetComponentAdaptersOfType in interface ContainergetComponentAdaptersOfType in class AbstractContainercomponentType - 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.public <T> List<T> getComponentInstancesOfType(Class<T> componentType) throws ContainerException
AbstractContainergetComponentInstancesOfType in interface ContainergetComponentInstancesOfType in class AbstractContainercomponentType - the searched type.ContainerExceptionpublic <T> T getComponentInstance(Object componentKey, Class<T> bindType, boolean autoRegistration) throws ContainerException
AbstractContainergetComponentInstance in interface ContainergetComponentInstance in class AbstractContainercomponentKey - the key that the component was registered with.bindType - the expected type of the instance if one can be found.autoRegistration - indicates whether the auto registration should be performed or notnull if no component has been registered for the specified
key.ContainerExceptionpublic <T> T getComponentInstanceOfType(Class<T> componentType, boolean autoRegistration)
AbstractContainergetComponentInstanceOfType in interface ContainergetComponentInstanceOfType in class AbstractContainercomponentType - the type of the component.autoRegistration - indicates whether the auto registration should be performed or notpublic ComponentAdapter<?> unregisterComponent(Object componentKey)
AbstractContainerunregisterComponent in interface ContainerunregisterComponent in class AbstractContainercomponentKey - key of the component to unregister.public <T> ComponentAdapter<T> registerComponentInstance(Object componentKey, T componentInstance) throws ContainerException
AbstractContainerregisterComponentInstance in interface ContainerregisterComponentInstance in class AbstractContainercomponentKey - 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.public <T> ComponentAdapter<T> registerComponentImplementation(Object componentKey, Class<T> componentImplementation) throws ContainerException
AbstractContainerregisterComponentImplementation in interface ContainerregisterComponentImplementation in class AbstractContainercomponentKey - 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.ContainerException - if registration of the component fails.public String getId()
Interceptor into the Interceptor
chain.getId in interface InterceptorgetId in class AbstractInterceptorCopyright © 2021 eXo Platform SAS. All Rights Reserved.