Package org.exoplatform.container
Class AbstractComponentAdapter<T>
java.lang.Object
org.exoplatform.container.AbstractComponentAdapter<T>
- All Implemented Interfaces:
Serializable,ComponentAdapter<T>,ComponentAdapter<T>
- Direct Known Subclasses:
InstanceComponentAdapter,MX4JComponentAdapter
public abstract class AbstractComponentAdapter<T>
extends Object
implements ComponentAdapter<T>, Serializable
- Version:
- $Id$
- Author:
- Nicolas Filotto
- See Also:
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedAbstractComponentAdapter(Object componentKey, Class<T> componentImplementation) Constructs a new ComponentAdapter for the given key and implementation. -
Method Summary
Modifier and TypeMethodDescriptionprotected voidRetrieve the class of the component.Retrieve the key associated with the component.toString()Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface org.exoplatform.container.spi.ComponentAdapter
getComponentInstance, isSingleton
-
Constructor Details
-
AbstractComponentAdapter
protected AbstractComponentAdapter(Object componentKey, Class<T> componentImplementation) throws ContainerException Constructs a new ComponentAdapter for the given key and implementation.- Parameters:
componentKey- the search key for this implementationcomponentImplementation- the concrete implementation- Throws:
ContainerException- if the key is a type and the implementation cannot be assigned to.
-
-
Method Details
-
getComponentKey
Retrieve the key associated with the component.- Specified by:
getComponentKeyin interfaceComponentAdapter<T>- 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
Retrieve the class of the component.- Specified by:
getComponentImplementationin interfaceComponentAdapter<T>- Specified by:
getComponentImplementationin interfaceComponentAdapter<T>- Returns:
- the component's implementation class. Should normally be a concrete class (ie, a class that can be instantiated).
-
checkTypeCompatibility
- Throws:
ContainerException
-
toString
-