org.mule.lifecycle
Class RegistryLifecycleManager

java.lang.Object
  extended by org.mule.lifecycle.AbstractLifecycleManager<Registry>
      extended by org.mule.lifecycle.RegistryLifecycleManager
All Implemented Interfaces:
LifecycleManager, RegistryLifecycleHelpers
Direct Known Subclasses:
RegistryBrokerLifecycleManager, SpringRegistryLifecycleManager

public class RegistryLifecycleManager
extends AbstractLifecycleManager<Registry>
implements RegistryLifecycleHelpers


Field Summary
protected  TreeMap<String,LifecycleCallback> callbacks
           
protected  MuleContext muleContext
           
protected  Map<String,LifecyclePhase> phases
           
 
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
RegistryLifecycleManager(String id, Registry object, Map<String,LifecyclePhase> phases)
           
RegistryLifecycleManager(String id, Registry object, MuleContext muleContext)
           
 
Method Summary
 void applyCompletedPhases(Object object)
          Successively applies all completed lifecycle phase to an object.
 void applyPhase(Object object, String fromPhase, String toPhase)
          Applies lifecycle phase to an object independent of the current lifecycle phase.
 void fireLifecycle(String destinationPhase)
          Applies lifecycle phase to a collection of objects.
protected  void invokePhase(String phase, Object object, LifecycleCallback callback)
           
protected  void registerPhase(String phaseName, LifecyclePhase phase)
           
protected  void registerPhase(String phaseName, LifecyclePhase phase, LifecycleCallback callback)
           
protected  void registerPhases()
           
protected  void registerTransitions()
           
 
Methods inherited from class org.mule.lifecycle.AbstractLifecycleManager
addDirectTransition, checkPhase, createLifecycleState, getCurrentPhase, getExecutingPhase, getLifecycleObject, getState, 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
 

Field Detail

phases

protected Map<String,LifecyclePhase> phases

callbacks

protected TreeMap<String,LifecycleCallback> callbacks

muleContext

protected MuleContext muleContext
Constructor Detail

RegistryLifecycleManager

public RegistryLifecycleManager(String id,
                                Registry object,
                                MuleContext muleContext)

RegistryLifecycleManager

public RegistryLifecycleManager(String id,
                                Registry object,
                                Map<String,LifecyclePhase> phases)
Method Detail

registerPhases

protected void registerPhases()

registerTransitions

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

registerPhase

protected void registerPhase(String phaseName,
                             LifecyclePhase phase)

registerPhase

protected void registerPhase(String phaseName,
                             LifecyclePhase phase,
                             LifecycleCallback callback)

fireLifecycle

public void fireLifecycle(String destinationPhase)
                   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<Registry>
Parameters:
destinationPhase - that phase to execute next
Throws:
LifecycleException - if the phase is not a valid transition of does not exist on this lifecycle manager

invokePhase

protected void invokePhase(String phase,
                           Object object,
                           LifecycleCallback callback)
                    throws LifecycleException
Overrides:
invokePhase in class AbstractLifecycleManager<Registry>
Throws:
LifecycleException

applyPhase

public void applyPhase(Object object,
                       String fromPhase,
                       String toPhase)
                throws LifecycleException
Description copied from interface: RegistryLifecycleHelpers
Applies lifecycle phase to an object independent of the current lifecycle phase. All phases between the current phase and the 'endPhase' will be executed.

Specified by:
applyPhase in interface RegistryLifecycleHelpers
Parameters:
object - the object to apply lifecycle to
fromPhase - the lifecycle phase the object is currently in. Must not be null.
toPhase - the lifecycle phase to transition the object to. Must not be null.
Throws:
LifecycleException - if there is an exception while invoking lifecycle on the object

applyCompletedPhases

public void applyCompletedPhases(Object object)
                          throws LifecycleException
Description copied from interface: RegistryLifecycleHelpers
Successively applies all completed lifecycle phase to an object.

Specified by:
applyCompletedPhases in interface RegistryLifecycleHelpers
Parameters:
object - the object to which the lifecycle should be applied
Throws:
LifecycleException - if there is an error while applying lifecycle to the object


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