dk.netarkivet.common.lifecycle
Class LifeCycleComponent

java.lang.Object
  extended by dk.netarkivet.common.lifecycle.LifeCycleComponent
All Implemented Interfaces:
ComponentLifeCycle
Direct Known Subclasses:
HarvestJobManager

public class LifeCycleComponent
extends java.lang.Object
implements ComponentLifeCycle

Takes care of the lifecycling of subcomponents(children). When extending this class you must:

  1. Add all lifecycle subcomponents with the addChild, before the start method is called.
  2. Call the super.start() operation to start the children.
  3. Call the super.shutdown operation to


    Constructor Summary
    LifeCycleComponent()
               
     
    Method Summary
     void addChild(ComponentLifeCycle childComponent)
              Adds a child ComponentLifeCycle.
     void shutdown()
              The inverse of the start() method.
     void start()
              Implements functionality for starting an instances of this ComponentLifeCycle object.
     
    Methods inherited from class java.lang.Object
    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
     

    Constructor Detail

    LifeCycleComponent

    public LifeCycleComponent()
    Method Detail

    start

    public void start()
    Description copied from interface: ComponentLifeCycle
    Implements functionality for starting an instances of this ComponentLifeCycle object. This may be loading files, establish connections, initializing data, starting threads, etc.

    Specified by:
    start in interface ComponentLifeCycle

    shutdown

    public void shutdown()
    Description copied from interface: ComponentLifeCycle
    The inverse of the start() method. Contains functionality for deallocation of ressources, clearing data, closing connections, stopping threads, etc

    Specified by:
    shutdown in interface ComponentLifeCycle

    addChild

    public void addChild(ComponentLifeCycle childComponent)
    Adds a child ComponentLifeCycle. The childs lifecycle will be managed by by the LifeCycleComponent.

    Parameters:
    childComponent - The child to add