eXo Kernel :: Container 2.5.0-GA

org.exoplatform.container.spi
Interface ComponentAdapter<T>

All Superinterfaces:
ComponentAdapter<T>

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 a Container for every registered component or instance. Each ComponentAdapter instance 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
 Class<? extends T> getComponentImplementation()
          Retrieve the class of the component.
 T getComponentInstance()
          Retrieve the component instance.
 Object getComponentKey()
          Retrieve the key associated with the component.
 boolean isSingleton()
          Indicates whether or not this adapter is a singleton
 

Method Detail

getComponentKey

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

Class<? extends 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).

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


eXo Kernel :: Container 2.5.0-GA

Copyright © 2014 eXo Platform SAS. All Rights Reserved.