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
 Class getComponentImplementation()
           
 Object getComponentInstance()
          Gets the component instance.
 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 Object getComponentKey()
Returns:
the component's key.

getComponentImplementation

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

getComponentInstance

public 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.