org.mule.api.lifecycle
Interface LifecycleManager

All Known Implementing Classes:
AbstractLifecycleManager, ComponentLifecycleManager, ConnectableLifecycleManager, ConnectorLifecycleManager, FlowConstructLifecycleManager, ModelLifecycleManager, MuleContextLifecycleManager, RegistryBrokerLifecycleManager, RegistryLifecycleManager, SedaStageLifecycleManager, ServiceLifecycleManager, SimpleLifecycleManager, SpringRegistryLifecycleManager

public interface LifecycleManager

The LifecycleManager is responsible for managing the different lifecycle phases of the server and managing the transitions between lifecycle phases.

Since:
3.0

Field Summary
static NotInLifecyclePhase NOT_IN_LIFECYCLE_PHASE
           
 
Method Summary
 void checkPhase(String name)
          Will check that the phase passed in is a valid next phase for this lifecycle manager.
 void fireLifecycle(String phase)
          Applies lifecycle phase to a collection of objects.
 String getCurrentPhase()
          The current phase for the lifecycle manager.
 String getExecutingPhase()
          Returns the lifecycle phase being executed.
 LifecycleState getState()
          Provides access to a state machine for this lifecycle manager.
 boolean isDirectTransition(String phase)
           
 boolean isPhaseComplete(String phaseName)
          Checks that a phase has completed
 void reset()
          Reset the lifecycle manager state back to 'not in lifecycle' phase
 

Field Detail

NOT_IN_LIFECYCLE_PHASE

static final NotInLifecyclePhase NOT_IN_LIFECYCLE_PHASE
Method Detail

fireLifecycle

void fireLifecycle(String phase)
                   throws LifecycleException
Applies lifecycle phase to a collection of objects.

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

getCurrentPhase

String getCurrentPhase()
The current phase for the lifecycle manager. While in transition this will reflect the last completed phase not the currently executing phase, use getExecutingPhase() to get the phase being executed.

Returns:
The current completed phase for the lifecycle manager

getExecutingPhase

String getExecutingPhase()
Returns the lifecycle phase being executed. This will be null if the lifecycle is not in transition

Returns:
the lifecycle phase being executed

reset

void reset()
Reset the lifecycle manager state back to 'not in lifecycle' phase


isPhaseComplete

boolean isPhaseComplete(String phaseName)
Checks that a phase has completed

Parameters:
phaseName - the name of the pahse to check for
Returns:
true if that phase has completed, false if the phase has not completed, or currently processing or does not exist

checkPhase

void checkPhase(String name)
                throws IllegalStateException
Will check that the phase passed in is a valid next phase for this lifecycle manager. If the phase is not a valid next transition an exception will be thrown

Parameters:
name - The name of the lifecycle to validate as a valid next transition
Throws:
IllegalStateException - if the lifecycle name is not recognised or the phase is not valid for the current lifecycle state

getState

LifecycleState getState()
Provides access to a state machine for this lifecycle manager. components in the registry can use this to assert lifecycle rather than managing thier own lifecycle state

Returns:
A state machine for this lifecycle manager
Since:
3.0

isDirectTransition

boolean isDirectTransition(String phase)


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