org.mule.lifecycle
Class SimpleLifecycleManager<O>

java.lang.Object
  extended by org.mule.lifecycle.AbstractLifecycleManager<O>
      extended by org.mule.lifecycle.SimpleLifecycleManager<O>
Type Parameters:
O - the object type being managed by this LifecycleManager
All Implemented Interfaces:
LifecycleManager
Direct Known Subclasses:
ComponentLifecycleManager, ConnectableLifecycleManager, ConnectorLifecycleManager, DefaultLifecycleManager, FlowConstructLifecycleManager, ModelLifecycleManager, SedaStageLifecycleManager, ServiceLifecycleManager

public abstract class SimpleLifecycleManager<O>
extends AbstractLifecycleManager<O>

This LifecycleManager implementation is designed to track the lifecycle of objects that support the Initialisable.PHASE_NAME, Startable.PHASE_NAME, Stoppable.PHASE_NAME and Disposable.PHASE_NAME phases and adds convenience methods for firing these phases by callbacks. This is an internal class used by Mule for managing state for objects such as Service, Connector and Agent, all of which can be controlled externally via JMX


Field Summary
 
Fields inherited from class org.mule.lifecycle.AbstractLifecycleManager
completedPhases, currentPhase, executingPhase, lifecycleManagerId, logger, object, phaseNames, state
 
Fields inherited from interface org.mule.api.lifecycle.LifecycleManager
NOT_IN_LIFECYCLE_PHASE
 
Constructor Summary
SimpleLifecycleManager(String id, O object)
           
 
Method Summary
abstract  void fireDisposePhase(LifecycleCallback<O> callback)
           
abstract  void fireInitialisePhase(LifecycleCallback<O> callback)
           
 void fireLifecycle(String phase)
          Applies lifecycle phase to a collection of objects.
abstract  void fireStartPhase(LifecycleCallback<O> callback)
           
abstract  void fireStopPhase(LifecycleCallback<O> callback)
           
protected  void registerTransitions()
           
 
Methods inherited from class org.mule.lifecycle.AbstractLifecycleManager
addDirectTransition, checkPhase, createLifecycleState, getCurrentPhase, getExecutingPhase, getLifecycleObject, getState, invokePhase, isDirectTransition, isDirectTransition, isPhaseComplete, notifyTransition, registerLifecycleCallback, reset, setCurrentPhase, setExecutingPhase
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SimpleLifecycleManager

public SimpleLifecycleManager(String id,
                              O object)
Method Detail

registerTransitions

protected void registerTransitions()
Specified by:
registerTransitions in class AbstractLifecycleManager<O>

fireLifecycle

public void fireLifecycle(String phase)
                   throws LifecycleException
Description copied from interface: LifecycleManager
Applies lifecycle phase to a collection of objects.

Specified by:
fireLifecycle in interface LifecycleManager
Overrides:
fireLifecycle in class AbstractLifecycleManager<O>
Parameters:
phase - that phase to execute next
Throws:
LifecycleException - if the phase is not a valid transition of does not exist on this lifecycle manager

fireInitialisePhase

public abstract void fireInitialisePhase(LifecycleCallback<O> callback)
                                  throws MuleException
Throws:
MuleException

fireStartPhase

public abstract void fireStartPhase(LifecycleCallback<O> callback)
                             throws MuleException
Throws:
MuleException

fireStopPhase

public abstract void fireStopPhase(LifecycleCallback<O> callback)
                            throws MuleException
Throws:
MuleException

fireDisposePhase

public abstract void fireDisposePhase(LifecycleCallback<O> callback)
                               throws MuleException
Throws:
MuleException


Copyright © 2003-2014 MuleSoft, Inc.. All Rights Reserved.