org.picocontainer.defaults
Class DefaultPicoContainer.OrderedComponentAdapterLifecycleManager

java.lang.Object
  extended by org.picocontainer.defaults.DefaultPicoContainer.OrderedComponentAdapterLifecycleManager
All Implemented Interfaces:
java.io.Serializable, LifecycleManager
Enclosing class:
DefaultPicoContainer

private class DefaultPicoContainer.OrderedComponentAdapterLifecycleManager
extends java.lang.Object
implements LifecycleManager, java.io.Serializable

Implementation of lifecycle manager which delegates to the container's component adapters. The component adapters will be ordered by dependency as registered in the container. This LifecycleManager will delegate calls on the lifecycle methods to the component adapters if these are themselves LifecycleManagers.

Since:
1.2
Author:
Mauro Talevi

Field Summary
private  java.util.List startedComponentAdapters
          List collecting the CAs which have been successfully started
 
Constructor Summary
private DefaultPicoContainer.OrderedComponentAdapterLifecycleManager()
           
 
Method Summary
 void dispose(PicoContainer node)
          Invoke the "dispose" method on the container's components.
 boolean hasLifecycle()
          Test if a container's component has a lifecycle.
 void start(PicoContainer node)
          Invoke the "start" method on the container's components.
 void stop(PicoContainer node)
          Invoke the "stop" method on the container's components.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

startedComponentAdapters

private java.util.List startedComponentAdapters
List collecting the CAs which have been successfully started

Constructor Detail

DefaultPicoContainer.OrderedComponentAdapterLifecycleManager

private DefaultPicoContainer.OrderedComponentAdapterLifecycleManager()
Method Detail

start

public void start(PicoContainer node)
Invoke the "start" method on the container's components. Loops over all component adapters and invokes start(PicoContainer) method on the ones which are LifecycleManagers

Specified by:
start in interface LifecycleManager
Parameters:
node - the container to "start" its components' lifecycle

stop

public void stop(PicoContainer node)
Invoke the "stop" method on the container's components. Loops over started component adapters (in inverse order) and invokes stop(PicoContainer) method on the ones which are LifecycleManagers

Specified by:
stop in interface LifecycleManager
Parameters:
node - the container to "stop" its components' lifecycle

dispose

public void dispose(PicoContainer node)
Invoke the "dispose" method on the container's components. Loops over all component adapters (in inverse order) and invokes dispose(PicoContainer) method on the ones which are LifecycleManagers

Specified by:
dispose in interface LifecycleManager
Parameters:
node - the container to "dispose" its components' lifecycle

hasLifecycle

public boolean hasLifecycle()
Description copied from interface: LifecycleManager
Test if a container's component has a lifecycle.

Specified by:
hasLifecycle in interface LifecycleManager
Returns:
true if the component has a lifecycle