org.picocontainer.defaults
Class ConstructorComponentAdapter

java.lang.Object
  extended byorg.picocontainer.defaults.AbstractComponentAdapter
      extended byorg.picocontainer.defaults.InstantiatingComponentAdapter
          extended byorg.picocontainer.defaults.ConstructorComponentAdapter
All Implemented Interfaces:
ComponentAdapter, Serializable
Direct Known Subclasses:
TransientComponentAdapter

public class ConstructorComponentAdapter
extends InstantiatingComponentAdapter

Instantiates components using Constructor-Based Dependency Injection. {@inheritDoc}

Version:
$Revision: 1.6 $
Author:
Aslak Hellesøy, Paul Hammant, Jon Tirsén, Zohar Melamed
See Also:
Serialized Form

Field Summary
 
Fields inherited from class org.picocontainer.defaults.InstantiatingComponentAdapter
parameters
 
Constructor Summary
ConstructorComponentAdapter(Object componentKey, Class componentImplementation)
          Use default parameters.
ConstructorComponentAdapter(Object componentKey, Class componentImplementation, Parameter[] parameters)
          Explicitly specifies parameters, if null uses default parameters.
 
Method Summary
protected  Object[] getConstructorArguments(ComponentAdapter[] adapterDependencies)
           
protected  Constructor getGreediestSatisifableConstructor(PicoContainer dependencyContainer)
           
protected  Class[] getMostSatisfiableDependencyTypes(PicoContainer dependencyContainer)
           
 
Methods inherited from class org.picocontainer.defaults.InstantiatingComponentAdapter
createDefaultParameters, getComponentInstance, instantiateComponent, verify
 
Methods inherited from class org.picocontainer.defaults.AbstractComponentAdapter
getComponentImplementation, getComponentKey, getContainer, setContainer, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ConstructorComponentAdapter

public ConstructorComponentAdapter(Object componentKey,
                                   Class componentImplementation,
                                   Parameter[] parameters)
                            throws AssignabilityRegistrationException,
                                   NotConcreteRegistrationException
Explicitly specifies parameters, if null uses default parameters. {@inheritDoc}


ConstructorComponentAdapter

public ConstructorComponentAdapter(Object componentKey,
                                   Class componentImplementation)
                            throws AssignabilityRegistrationException,
                                   NotConcreteRegistrationException
Use default parameters. {@inheritDoc}

Method Detail

getMostSatisfiableDependencyTypes

protected Class[] getMostSatisfiableDependencyTypes(PicoContainer dependencyContainer)
                                             throws PicoIntrospectionException,
                                                    AmbiguousComponentResolutionException,
                                                    AssignabilityRegistrationException,
                                                    NotConcreteRegistrationException
Specified by:
getMostSatisfiableDependencyTypes in class InstantiatingComponentAdapter
Throws:
PicoIntrospectionException
AmbiguousComponentResolutionException
AssignabilityRegistrationException
NotConcreteRegistrationException

getGreediestSatisifableConstructor

protected Constructor getGreediestSatisifableConstructor(PicoContainer dependencyContainer)
                                                  throws PicoIntrospectionException,
                                                         UnsatisfiableDependenciesException,
                                                         AmbiguousComponentResolutionException,
                                                         AssignabilityRegistrationException,
                                                         NotConcreteRegistrationException
Specified by:
getGreediestSatisifableConstructor in class InstantiatingComponentAdapter
Throws:
PicoIntrospectionException
UnsatisfiableDependenciesException
AmbiguousComponentResolutionException
AssignabilityRegistrationException
NotConcreteRegistrationException

getConstructorArguments

protected Object[] getConstructorArguments(ComponentAdapter[] adapterDependencies)
Specified by:
getConstructorArguments in class InstantiatingComponentAdapter


Copyright © 2003-2004 Codehaus. All Rights Reserved.