org.mule.api.lifecycle
Interface LifecycleManager

All Known Implementing Classes:
MuleContextLifecycleManager, RegistryLifecycleManager

public interface LifecycleManager

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


Method Summary
 void applyCompletedPhases(Object object)
          Successively applies all completed lifecycle phase to an object.
 void applyPhase(Object object, String phase)
          Applies lifecycle phase to an object independent of the current lifecycle phase.
 void checkPhase(String name)
           
 void fireLifecycle(Registry registry, 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.
 List<LifecyclePair> getLifecyclePairs()
          The lifecycle pairs that will be invoked by this lifecycle manager
 LifecycleState getState()
          Provides access to a state machine for this lifecycle manager.
 boolean isPhaseComplete(String phaseName)
           
 void registerLifecycle(LifecyclePair lifecyclePair)
          Register a lifecycle pair that will be invoked by this lifecycle manager The order in which the lifecycle pairs are registered will be the order in which the life cycle phases will be invoked the LifecyclePair.getBegin() phases will be called in order, the LifecyclePair.getEnd() will be called in opposite order.
 void reset()
          Reset the lifecycle manager state back to 'not in lifecycle' phase
 void setLifecyclePairs(List<LifecyclePair> lifecyclePairs)
          The lifecycle pairs that will be invoked by this lifecycle manager The order the list will be the order in which the life cycle phases will be invoked the LifecyclePair.getBegin() phases will be called in order, the LifecyclePair.getEnd() will be called in opposite order.
 

Method Detail

getLifecyclePairs

List<LifecyclePair> getLifecyclePairs()
The lifecycle pairs that will be invoked by this lifecycle manager

Returns:
The lifecycle pairs that will be invoked by this lifecycle manager
Since:
3.0

setLifecyclePairs

void setLifecyclePairs(List<LifecyclePair> lifecyclePairs)
The lifecycle pairs that will be invoked by this lifecycle manager The order the list will be the order in which the life cycle phases will be invoked the LifecyclePair.getBegin() phases will be called in order, the LifecyclePair.getEnd() will be called in opposite order. i.e. call initialise first and dispose last.

Parameters:
lifecyclePairs - The lifecycle pairs that will be invoked by this lifecycle manager
Since:
3.0

registerLifecycle

void registerLifecycle(LifecyclePair lifecyclePair)
Register a lifecycle pair that will be invoked by this lifecycle manager The order in which the lifecycle pairs are registered will be the order in which the life cycle phases will be invoked the LifecyclePair.getBegin() phases will be called in order, the LifecyclePair.getEnd() will be called in opposite order. i.e. call initialise first and dispose last.

Parameters:
lifecyclePair - a lifecycle pair that will be invoked by this lifecycle manager
Since:
3.0

fireLifecycle

void fireLifecycle(Registry registry,
                   String phase)
                   throws MuleException
Applies lifecycle phase to a collection of objects.

Throws:
MuleException

applyPhase

void applyPhase(Object object,
                String phase)
                throws MuleException
Applies lifecycle phase to an object independent of the current lifecycle phase. All phases between the current phase and the 'endPhase' will be executed.

Parameters:
endPhase - the final phase to execute on the object. All phases inbetween current and end will be executed
Throws:
MuleException

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)

applyCompletedPhases

void applyCompletedPhases(Object object)
                          throws MuleException
Successively applies all completed lifecycle phase to an object.

Throws:
MuleException

checkPhase

void checkPhase(String name)
                throws IllegalStateException
Throws:
IllegalStateException

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


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