| org.picocontainer.ComponentAdapter
ComponentAdapter | public interface ComponentAdapter (Code) | | A component adapter is responsible for providing a specific component
instance of type . An instance of an implementation of this interface is
used inside a
PicoContainer 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.
author: Jon Tirsén author: Paul Hammant author: Aslak Hellesøy |
accept | void accept(PicoVisitor visitor)(Code) | | Accepts a visitor for this ComponentAdapter. The method is normally called by visiting a
PicoContainer , that
cascades the visitor also down to all its ComponentAdapter instances.
Parameters: visitor - the visitor. |
findAdapterOfType | U findAdapterOfType(Class<U> componentAdapterType)(Code) | | |
getComponentImplementation | Class<T> getComponentImplementation()(Code) | | Retrieve the class of the component.
the component's implementation class. Should normally be a concrete class (ie, a class that can beinstantiated). |
getComponentInstance | T getComponentInstance(PicoContainer container) throws PicoCompositionException(Code) | | Retrieve the component instance. This method will usually create a new instance each time it is called, but that
is not required. For example,
org.picocontainer.behaviors.Cached will always return the
same instance.
Parameters: container - the PicoContainer, that is used to resolve any possible dependencies of the instance. the component instance. throws: PicoCompositionException - if the component has dependencies which could not be resolved, orinstantiation of the component lead to an ambigous situation within thecontainer. |
getComponentKey | Object getComponentKey()(Code) | | Retrieve the key associated with the component.
the component's key. Should either be a class type (normally an interface) or an identifier that isunique (within the scope of the current PicoContainer). |
verify | void verify(PicoContainer container) throws PicoCompositionException(Code) | | Verify that all dependencies for this adapter can be satisifed. Normally, the adapter should verify this by
checking that the associated PicoContainer contains all the needed dependnecies.
Parameters: container - the PicoContainer, that is used to resolve any possible dependencies of the instance. throws: PicoCompositionException - if one or more dependencies cannot be resolved. |
|
|