org.picocontainer.defaults
Class DefaultComponentAdapter

java.lang.Object
  extended byorg.picocontainer.defaults.AbstractComponentAdapter
      extended byorg.picocontainer.defaults.DefaultComponentAdapter
All Implemented Interfaces:
ComponentAdapter, Serializable

public class DefaultComponentAdapter
extends AbstractComponentAdapter

Version:
$Revision: 1.10 $
Author:
Jon Tirsén
See Also:
Serialized Form

Constructor Summary
DefaultComponentAdapter(Object componentKey, Class componentImplementation)
          Use default parameters.
DefaultComponentAdapter(Object componentKey, Class componentImplementation, Parameter[] parameters)
          Explicitly specifies parameters, if null uses default parameters.
 
Method Summary
 boolean equals(Object object)
           
 Object getComponentInstance(MutablePicoContainer mutablePicoContainer)
          Gets the component instance.
 Class[] getDependencies(MutablePicoContainer componentRegistry)
           
static boolean isAssignableFrom(Class actual, Class requested)
           
 
Methods inherited from class org.picocontainer.defaults.AbstractComponentAdapter
getComponentImplementation, getComponentKey
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DefaultComponentAdapter

public DefaultComponentAdapter(Object componentKey,
                               Class componentImplementation,
                               Parameter[] parameters)
                        throws AssignabilityRegistrationException,
                               NotConcreteRegistrationException
Explicitly specifies parameters, if null uses default parameters.

Parameters:
componentKey -
componentImplementation -
parameters -

DefaultComponentAdapter

public DefaultComponentAdapter(Object componentKey,
                               Class componentImplementation)
                        throws AssignabilityRegistrationException,
                               NotConcreteRegistrationException
Use default parameters.

Parameters:
componentKey -
componentImplementation -
Method Detail

getDependencies

public Class[] getDependencies(MutablePicoContainer componentRegistry)
                        throws PicoIntrospectionException,
                               AmbiguousComponentResolutionException,
                               AssignabilityRegistrationException,
                               NotConcreteRegistrationException
Throws:
PicoIntrospectionException
AmbiguousComponentResolutionException
AssignabilityRegistrationException
NotConcreteRegistrationException

getComponentInstance

public Object getComponentInstance(MutablePicoContainer mutablePicoContainer)
                            throws PicoInitializationException,
                                   PicoIntrospectionException,
                                   AssignabilityRegistrationException,
                                   NotConcreteRegistrationException
Description copied from interface: ComponentAdapter
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:
mutablePicoContainer - registries where the adapter can look for dependent component instances
Returns:
the component instance
Throws:
PicoInitializationException - if the component couldn't be instantiated
PicoIntrospectionException
AssignabilityRegistrationException
NotConcreteRegistrationException

isAssignableFrom

public static boolean isAssignableFrom(Class actual,
                                       Class requested)

equals

public boolean equals(Object object)


Copyright © 2003 Codehaus. All Rights Reserved.