Package org.exoplatform.container.spi
Interface ComponentAdapter<T>
-
- All Superinterfaces:
ComponentAdapter<T>
- All Known Implementing Classes:
AbstractComponentAdapter,InstanceComponentAdapter,ManageableComponentAdapter,MX4JComponentAdapter
public interface ComponentAdapter<T> extends ComponentAdapter<T>
A component adapter is responsible for providing a specific component instance. An instance of an implementation of this interface is used inside aContainerfor every registered component or instance. EachComponentAdapterinstance has to have a key which is unique within that container. The key itself is either a class type (normally an interface) or an identifier.- Version:
- $Id$
- Author:
- Nicolas Filotto
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description Class<? extends T>getComponentImplementation()Retrieve the class of the component.TgetComponentInstance()Retrieve the component instance.ObjectgetComponentKey()Retrieve the key associated with the component.booleanisSingleton()Indicates whether or not this adapter is a singleton
-
-
-
Method Detail
-
getComponentKey
Object getComponentKey()
Retrieve the key associated with the component.- Specified by:
getComponentKeyin interfaceComponentAdapter<T>- Returns:
- the component's key. Should either be a class type (normally an interface) or an identifier that is unique (within the scope of the current Container).
-
getComponentImplementation
Class<? extends T> getComponentImplementation()
Retrieve the class of the component.- Specified by:
getComponentImplementationin interfaceComponentAdapter<T>- Returns:
- the component's implementation class. Should normally be a concrete class (ie, a class that can be instantiated).
-
getComponentInstance
T getComponentInstance() throws ContainerException
Retrieve the component instance. This method will usually create a new instance each time it is called, but that is not required.- Returns:
- the component instance.
- Throws:
ContainerException- if the component could not be instantiated. Or if the component has dependencies which could not be resolved, or instantiation of the component lead to an ambiguous situation within the container.
-
isSingleton
boolean isSingleton()
Indicates whether or not this adapter is a singleton
-
-