org.picocontainer
Interface ComponentAdapter

All Known Implementing Classes:
AbstractComponentAdapter, DecoratingComponentAdapter

public interface ComponentAdapter

A component adapter is responsible for providing a specific component instance.

Author:
Aslak Hellesøy, Jon Tirsén

Method Summary
 java.lang.Class getComponentImplementation()
           
 java.lang.Object getComponentInstance()
          Gets the component instance.
 java.lang.Object getComponentKey()
           
 PicoContainer getContainer()
           
 void setContainer(PicoContainer picoContainer)
          Sets the container in which this instance is registered, called by the container upon registration.
 void verify()
          Verify that all dependencies for this adapter can be satisifed.
 

Method Detail

getComponentKey

public java.lang.Object getComponentKey()
Returns:
the component's key.

getComponentImplementation

public java.lang.Class getComponentImplementation()
Returns:
the component's implementation class.

getComponentInstance

public java.lang.Object getComponentInstance()
                                      throws PicoInitializationException,
                                             PicoIntrospectionException
Gets the component instance. This method will usually create a new instance for each call (an exception is CachingComponentAdapter).

Returns:
the component instance.
Throws:
PicoInitializationException - if the component couldn't be instantiated
PicoIntrospectionException

verify

public void verify()
            throws UnsatisfiableDependenciesException
Verify that all dependencies for this adapter can be satisifed.

Throws:
PicoIntrospectionException - if the dependencies cannot be resolved.
UnsatisfiableDependenciesException

getContainer

public PicoContainer getContainer()

setContainer

public void setContainer(PicoContainer picoContainer)
Sets the container in which this instance is registered, called by the container upon registration.

Parameters:
picoContainer -


Copyright © 2003-2004 Codehaus. All Rights Reserved.