org.picocontainer.alternatives
Class ImmutablePicoContainer

java.lang.Object
  extended by org.picocontainer.alternatives.ImmutablePicoContainer
All Implemented Interfaces:
java.io.Serializable, Disposable, PicoContainer, Startable

Deprecated. since 1.2, use the ImmutablePicoContainerProxyFactory

public class ImmutablePicoContainer
extends java.lang.Object
implements PicoContainer, java.io.Serializable

Since:
1.1
Version:
$Revision: 2286 $
Author:
Paul Hammant
See Also:
Serialized Form

Field Summary
private  PicoContainer delegate
          Deprecated.  
 
Constructor Summary
ImmutablePicoContainer(PicoContainer delegate)
          Deprecated.  
 
Method Summary
 void accept(PicoVisitor visitor)
          Deprecated. Accepts a visitor that should visit the child containers, component adapters and component instances.
 void dispose()
          Deprecated. Dispose this component.
 ComponentAdapter getComponentAdapter(java.lang.Object componentKey)
          Deprecated. Find a component adapter associated with the specified key.
 ComponentAdapter getComponentAdapterOfType(java.lang.Class componentType)
          Deprecated. Find a component adapter associated with the specified type.
 java.util.Collection getComponentAdapters()
          Deprecated. Retrieve all the component adapters inside this container.
 java.util.List getComponentAdaptersOfType(java.lang.Class componentType)
          Deprecated. Retrieve all component adapters inside this container that are associated with the specified type.
 java.lang.Object getComponentInstance(java.lang.Object componentKey)
          Deprecated. Retrieve a component instance registered with a specific key.
 java.lang.Object getComponentInstanceOfType(java.lang.Class componentType)
          Deprecated. Find a component instance matching the specified type.
 java.util.List getComponentInstances()
          Deprecated. Retrieve all the registered component instances in the container, (not including those in the parent container).
 java.util.List getComponentInstancesOfType(java.lang.Class type)
          Deprecated. Returns a List of components of a certain componentType.
 PicoContainer getParent()
          Deprecated. Retrieve the parent container of this container.
 void start()
          Deprecated. Start this component.
 void stop()
          Deprecated. Stop this component.
 void verify()
          Deprecated. since 1.1 - Use "new VerifyingVisitor().traverse(this)"
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

delegate

private PicoContainer delegate
Deprecated. 
Constructor Detail

ImmutablePicoContainer

public ImmutablePicoContainer(PicoContainer delegate)
Deprecated. 
Method Detail

getComponentInstance

public java.lang.Object getComponentInstance(java.lang.Object componentKey)
Deprecated. 
Description copied from interface: PicoContainer
Retrieve a component instance registered with a specific key. If a component cannot be found in this container, the parent container (if one exists) will be searched.

Specified by:
getComponentInstance in interface PicoContainer
Parameters:
componentKey - the key that the component was registered with.
Returns:
an instantiated component, or null if no component has been registered for the specified key.

getComponentInstanceOfType

public java.lang.Object getComponentInstanceOfType(java.lang.Class componentType)
Deprecated. 
Description copied from interface: PicoContainer
Find a component instance matching the specified type.

Specified by:
getComponentInstanceOfType in interface PicoContainer
Parameters:
componentType - the type of the component
Returns:
an instantiated component matching the class, or null if no component has been registered with a matching type

getComponentInstances

public java.util.List getComponentInstances()
Deprecated. 
Description copied from interface: PicoContainer
Retrieve all the registered component instances in the container, (not including those in the parent container). The components are returned in their order of instantiation, which depends on the dependency order between them.

Specified by:
getComponentInstances in interface PicoContainer
Returns:
all the components.

getParent

public PicoContainer getParent()
Deprecated. 
Description copied from interface: PicoContainer
Retrieve the parent container of this container.

Specified by:
getParent in interface PicoContainer
Returns:
a PicoContainer instance, or null if this container does not have a parent.

getComponentAdapter

public ComponentAdapter getComponentAdapter(java.lang.Object componentKey)
Deprecated. 
Description copied from interface: PicoContainer
Find a component adapter associated with the specified key. If a component adapter cannot be found in this container, the parent container (if one exists) will be searched.

Specified by:
getComponentAdapter in interface PicoContainer
Parameters:
componentKey - the key that the component was registered with.
Returns:
the component adapter associated with this key, or null if no component has been registered for the specified key.

getComponentAdapterOfType

public ComponentAdapter getComponentAdapterOfType(java.lang.Class componentType)
Deprecated. 
Description copied from interface: PicoContainer
Find a component adapter associated with the specified type. If a component adapter cannot be found in this container, the parent container (if one exists) will be searched.

Specified by:
getComponentAdapterOfType in interface PicoContainer
Parameters:
componentType - the type of the component.
Returns:
the component adapter associated with this class, or null if no component has been registered for the specified key.

getComponentAdapters

public java.util.Collection getComponentAdapters()
Deprecated. 
Description copied from interface: PicoContainer
Retrieve all the component adapters inside this container. The component adapters from the parent container are not returned.

Specified by:
getComponentAdapters in interface PicoContainer
Returns:
a collection containing all the ComponentAdapters inside this container. The collection will not be modifiable.
See Also:
a variant of this method which returns the component adapters inside this container that are associated with the specified type.

getComponentAdaptersOfType

public java.util.List getComponentAdaptersOfType(java.lang.Class componentType)
Deprecated. 
Description copied from interface: PicoContainer
Retrieve all component adapters inside this container that are associated with the specified type. The component adapters from the parent container are not returned.

Specified by:
getComponentAdaptersOfType in interface PicoContainer
Parameters:
componentType - the type of the components.
Returns:
a collection containing all the ComponentAdapters inside this container that are associated with the specified type. Changes to this collection will not be reflected in the container itself.

verify

public void verify()
            throws PicoVerificationException
Deprecated. since 1.1 - Use "new VerifyingVisitor().traverse(this)"

Description copied from interface: PicoContainer
Verify that the dependencies for all the registered components can be satisfied. No components are instantiated during the verification process.

Specified by:
verify in interface PicoContainer
Throws:
PicoVerificationException - if there are unsatisifiable dependencies.

getComponentInstancesOfType

public java.util.List getComponentInstancesOfType(java.lang.Class type)
                                           throws PicoException
Deprecated. 
Description copied from interface: PicoContainer
Returns a List of components of a certain componentType. The list is ordered by instantiation order, starting with the components instantiated first at the beginning.

Specified by:
getComponentInstancesOfType in interface PicoContainer
Parameters:
type - the searched type.
Returns:
a List of components.
Throws:
PicoException - if the instantiation of a component fails

accept

public void accept(PicoVisitor visitor)
Deprecated. 
Description copied from interface: PicoContainer
Accepts a visitor that should visit the child containers, component adapters and component instances.

Specified by:
accept in interface PicoContainer
Parameters:
visitor - the visitor

start

public void start()
Deprecated. 
Description copied from interface: Startable
Start this component. Called initially at the begin of the lifecycle. It can be called again after a stop.

Specified by:
start in interface Startable

stop

public void stop()
Deprecated. 
Description copied from interface: Startable
Stop this component. Called near the end of the lifecycle. It can be called again after a further start. Implement Disposable if you need a single call at the definite end of the lifecycle.

Specified by:
stop in interface Startable

dispose

public void dispose()
Deprecated. 
Description copied from interface: Disposable
Dispose this component. The component should deallocate all resources. The contract for this method defines a single call at the end of this component's life.

Specified by:
dispose in interface Disposable