org.picocontainer
Interface ComponentAdapter

All Known Implementing Classes:
AbstractComponentAdapter, DecoratingComponentAdapter

public interface ComponentAdapter

A component adapter is responsible for instantiating and caching a specific component instance.

Author:
Aslak Hellesøy, Jon Tirsén

Method Summary
 Class getComponentImplementation()
          The component's implementation class.
 Object getComponentInstance(MutablePicoContainer picoContainer)
          Gets the component instance.
 Object getComponentKey()
          The component's key.
 

Method Detail

getComponentKey

public Object getComponentKey()
The component's key.

Returns:

getComponentImplementation

public Class getComponentImplementation()
The component's implementation class.

Returns:

getComponentInstance

public Object getComponentInstance(MutablePicoContainer picoContainer)
                            throws PicoInitializationException,
                                   PicoIntrospectionException
Gets the component instance. Subsequent calls to this method with the same arguments should return the same object (it should be caching).

This method should also register the instantiated component with the pico container.

Parameters:
picoContainer - registries where the adapter can look for dependent component instances
Returns:
the component instance
Throws:
PicoInitializationException - if the component couldn't be instantiated
PicoIntrospectionException


Copyright © 2003 Codehaus. All Rights Reserved.