org.picocontainer.defaults
Class InstantiatingComponentAdapter
java.lang.Object
org.picocontainer.defaults.AbstractComponentAdapter
org.picocontainer.defaults.InstantiatingComponentAdapter
- All Implemented Interfaces:
- ComponentAdapter, java.io.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.13 $
- Author:
- Aslak Hellesøy, Paul Hammant
- See Also:
- Serialized Form
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
parameters
protected Parameter[] parameters
InstantiatingComponentAdapter
public InstantiatingComponentAdapter(java.lang.Object componentKey,
java.lang.Class componentImplementation,
Parameter[] parameters)
throws AssignabilityRegistrationException,
NotConcreteRegistrationException
getComponentInstance
public java.lang.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(java.lang.Class[] parameters,
PicoContainer picoContainer)
instantiateComponent
protected java.lang.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 java.lang.Class[] getMostSatisfiableDependencyTypes(PicoContainer dependencyContainer)
throws PicoIntrospectionException,
AmbiguousComponentResolutionException,
AssignabilityRegistrationException,
NotConcreteRegistrationException
- Throws:
PicoIntrospectionException
AmbiguousComponentResolutionException
AssignabilityRegistrationException
NotConcreteRegistrationException
getGreediestSatisifableConstructor
protected abstract java.lang.reflect.Constructor getGreediestSatisifableConstructor(PicoContainer dependencyContainer)
throws PicoIntrospectionException,
UnsatisfiableDependenciesException,
AmbiguousComponentResolutionException,
AssignabilityRegistrationException,
NotConcreteRegistrationException
- Throws:
PicoIntrospectionException
UnsatisfiableDependenciesException
AmbiguousComponentResolutionException
AssignabilityRegistrationException
NotConcreteRegistrationException
getConstructorArguments
protected abstract java.lang.Object[] getConstructorArguments(ComponentAdapter[] adapterDependencies)
Copyright © 2003-2004 Codehaus. All Rights Reserved.