eXo Kernel :: Container 2.5.0-GA

org.exoplatform.container
Class AbstractComponentAdapter<T>

java.lang.Object
  extended by org.exoplatform.container.AbstractComponentAdapter<T>
All Implemented Interfaces:
Serializable, 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:
Serialized Form

Constructor Summary
protected AbstractComponentAdapter(Object componentKey, Class<T> componentImplementation)
          Constructs a new ComponentAdapter for the given key and implementation.
 
Method Summary
protected  void checkTypeCompatibility()
           
 Class<T> getComponentImplementation()
          Retrieve the class of the component.
 Object getComponentKey()
          Retrieve the key associated with the component.
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.exoplatform.container.spi.ComponentAdapter
getComponentInstance, isSingleton
 

Constructor Detail

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 implementation
componentImplementation - the concrete implementation
Throws:
ContainerException - if the key is a type and the implementation cannot be assigned to.
Method Detail

getComponentKey

public Object getComponentKey()
Retrieve the key associated with the component.

Specified by:
getComponentKey in interface ComponentAdapter<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

public Class<T> getComponentImplementation()
Retrieve the class of the component.

Specified by:
getComponentImplementation in interface ComponentAdapter<T>
Returns:
the component's implementation class. Should normally be a concrete class (ie, a class that can be instantiated).

checkTypeCompatibility

protected void checkTypeCompatibility()
                               throws ContainerException
Throws:
ContainerException

toString

public String toString()
Overrides:
toString in class Object
Returns:
Returns the ComponentAdapter's class name and the component's key.
See Also:
Object.toString()

eXo Kernel :: Container 2.5.0-GA

Copyright © 2014 eXo Platform SAS. All Rights Reserved.