public class DefaultLifecyclePhase extends Object implements LifecyclePhase
LifecycleManager and by used to enforce a lifecycle phase on an object.
Usually, Lifecycle phases have a fixed configuration in which case a specialisation of this class should be
created that initialises its configuration internally.
Note that this class and LifecycleTransitionResult both make assumptions about
the interfaces used - the return values and exceptions. These are, currently, that the return value is either
void or LifecycleTransitionResult and either 0 or 1 exceptions can be
thrown which are either InstantiationException or LifecycleException.
LifecyclePhase| Modifier and Type | Field and Description |
|---|---|
protected org.apache.commons.logging.Log |
logger |
ALL_PHASES| Constructor and Description |
|---|
DefaultLifecyclePhase(String name,
Class lifecycleClass,
String oppositeLifecyclePhase) |
| Modifier and Type | Method and Description |
|---|---|
void |
addOrderedLifecycleObject(LifecycleObject lco) |
void |
applyLifecycle(Object o) |
void |
fireLifecycle(MuleContext muleContext,
String currentPhase) |
Class[] |
getIgnoredObjectTypes() |
Class |
getLifecycleClass() |
String |
getName() |
String |
getOppositeLifecyclePhase() |
Set |
getOrderedLifecycleObjects() |
int |
getRegistryScope() |
Set |
getSupportedPhases() |
protected boolean |
ignoreType(Class type) |
boolean |
isPhaseSupported(String phase) |
void |
registerSupportedPhase(String phase) |
void |
removeOrderedLifecycleObject(LifecycleObject lco) |
void |
setIgnoredObjectTypes(Class[] ignorredObjectTypes) |
void |
setLifecycleClass(Class lifecycleClass) |
void |
setOrderedLifecycleObjects(Set orderedLifecycleObjects) |
void |
setRegistryScope(int registryScope) |
void |
setSupportedPhases(Set supportedPhases) |
protected List |
sortLifecycleInstances(Collection objects,
LifecycleObject lo)
Subclasses can override this method to order
objects before
the lifecycle method is applied to them. |
public void fireLifecycle(MuleContext muleContext, String currentPhase) throws MuleException
fireLifecycle in interface LifecyclePhaseMuleExceptionprotected List sortLifecycleInstances(Collection objects, LifecycleObject lo)
objects before
the lifecycle method is applied to them.
This method does not apply any special ordering to objects.objects - lo - public void addOrderedLifecycleObject(LifecycleObject lco)
addOrderedLifecycleObject in interface LifecyclePhasepublic void removeOrderedLifecycleObject(LifecycleObject lco)
removeOrderedLifecycleObject in interface LifecyclePhaseprotected boolean ignoreType(Class type)
public Set getOrderedLifecycleObjects()
getOrderedLifecycleObjects in interface LifecyclePhasepublic void setOrderedLifecycleObjects(Set orderedLifecycleObjects)
setOrderedLifecycleObjects in interface LifecyclePhasepublic Class[] getIgnoredObjectTypes()
getIgnoredObjectTypes in interface LifecyclePhasepublic void setIgnoredObjectTypes(Class[] ignorredObjectTypes)
setIgnoredObjectTypes in interface LifecyclePhasepublic Class getLifecycleClass()
getLifecycleClass in interface LifecyclePhasepublic void setLifecycleClass(Class lifecycleClass)
setLifecycleClass in interface LifecyclePhasepublic String getName()
getName in interface LifecyclePhasepublic Set getSupportedPhases()
getSupportedPhases in interface LifecyclePhasepublic void setSupportedPhases(Set supportedPhases)
setSupportedPhases in interface LifecyclePhasepublic void registerSupportedPhase(String phase)
registerSupportedPhase in interface LifecyclePhasepublic boolean isPhaseSupported(String phase)
isPhaseSupported in interface LifecyclePhasepublic void applyLifecycle(Object o) throws LifecycleException
applyLifecycle in interface LifecyclePhaseLifecycleExceptionpublic int getRegistryScope()
getRegistryScope in interface LifecyclePhasepublic void setRegistryScope(int registryScope)
setRegistryScope in interface LifecyclePhasepublic String getOppositeLifecyclePhase()
getOppositeLifecyclePhase in interface LifecyclePhaseCopyright © 2003-2012 MuleSource, Inc.. All Rights Reserved.