org.picocontainer.defaults
Class InstantiatingComponentAdapter
java.lang.Object
org.picocontainer.defaults.AbstractComponentAdapter
org.picocontainer.defaults.InstantiatingComponentAdapter
- All Implemented Interfaces:
- ComponentAdapter, Serializable
- Direct Known Subclasses:
- BeanComponentAdapter, ConstructorComponentAdapter
- public abstract class InstantiatingComponentAdapter
- extends AbstractComponentAdapter
This ComponentAdapter will instantiate a new object for each call to
ComponentAdapter.getComponentInstance()
. That means that
when used with a PicoContainer, getComponentInstance will return a new
object each time.
- Version:
- $Revision: 1.8 $
- Author:
- Aslak Hellesøy, Paul Hammant
- See Also:
- Serialized Form
parameters
protected Parameter[] parameters
InstantiatingComponentAdapter
public InstantiatingComponentAdapter(Object componentKey,
Class componentImplementation,
Parameter[] parameters)
throws AssignabilityRegistrationException,
NotConcreteRegistrationException
getComponentInstance
public Object getComponentInstance()
throws PicoInitializationException,
PicoIntrospectionException,
AssignabilityRegistrationException,
NotConcreteRegistrationException
- Description copied from interface:
ComponentAdapter
- 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
AssignabilityRegistrationException
NotConcreteRegistrationException
createDefaultParameters
protected static Parameter[] createDefaultParameters(Class[] parameters,
PicoContainer picoContainer)
instantiateComponent
protected Object instantiateComponent(ComponentAdapter[] adapterDependencies,
PicoContainer dependencyContainer)
throws PicoInitializationException,
PicoIntrospectionException,
AssignabilityRegistrationException,
NotConcreteRegistrationException
- Throws:
PicoInitializationException
PicoIntrospectionException
AssignabilityRegistrationException
NotConcreteRegistrationException
verify
public void verify()
throws UnsatisfiableDependenciesException
- Description copied from interface:
ComponentAdapter
- Verify that all dependencies for this adapter can be satisifed.
- Throws:
UnsatisfiableDependenciesException
getMostSatisfiableDependencyTypes
protected abstract Class[] getMostSatisfiableDependencyTypes(PicoContainer dependencyContainer)
throws PicoIntrospectionException,
AmbiguousComponentResolutionException,
AssignabilityRegistrationException,
NotConcreteRegistrationException
- Throws:
PicoIntrospectionException
AmbiguousComponentResolutionException
AssignabilityRegistrationException
NotConcreteRegistrationException
getGreediestSatisifableConstructor
protected abstract Constructor getGreediestSatisifableConstructor(PicoContainer dependencyContainer)
throws PicoIntrospectionException,
UnsatisfiableDependenciesException,
AmbiguousComponentResolutionException,
AssignabilityRegistrationException,
NotConcreteRegistrationException
- Throws:
PicoIntrospectionException
UnsatisfiableDependenciesException
AmbiguousComponentResolutionException
AssignabilityRegistrationException
NotConcreteRegistrationException
getConstructorArguments
protected abstract Object[] getConstructorArguments(ComponentAdapter[] adapterDependencies)
Copyright © 2003-2004 Codehaus. All Rights Reserved.