org.picocontainer.defaults
Class TransientComponentAdapter

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

public class TransientComponentAdapter
extends AbstractComponentAdapter

Version:
$Revision: 1.2 $
Author:
Jon Tirsén, Zohar Melamed
See Also:
Serialized Form

Constructor Summary
TransientComponentAdapter(Object componentKey, Class componentImplementation)
          Use default parameters.
TransientComponentAdapter(Object componentKey, Class componentImplementation, Parameter[] parameters)
          Explicitly specifies parameters, if null uses default parameters.
 
Method Summary
 boolean equals(Object object)
           
 Object getComponentInstance(MutablePicoContainer picoContainer)
          Gets the component instance.
 Class[] getDependencies(MutablePicoContainer picoContainer)
           
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

TransientComponentAdapter

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

Parameters:
componentKey -
componentImplementation -
parameters -

TransientComponentAdapter

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

Parameters:
componentKey -
componentImplementation -
Method Detail

getDependencies

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

getComponentInstance

public Object getComponentInstance(MutablePicoContainer picoContainer)
                            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:
picoContainer - container 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.