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 LifecyclePhase
MuleException
protected 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 LifecyclePhase
public void removeOrderedLifecycleObject(LifecycleObject lco)
removeOrderedLifecycleObject
in interface LifecyclePhase
protected boolean ignoreType(Class type)
public Set getOrderedLifecycleObjects()
getOrderedLifecycleObjects
in interface LifecyclePhase
public void setOrderedLifecycleObjects(Set orderedLifecycleObjects)
setOrderedLifecycleObjects
in interface LifecyclePhase
public Class[] getIgnoredObjectTypes()
getIgnoredObjectTypes
in interface LifecyclePhase
public void setIgnoredObjectTypes(Class[] ignorredObjectTypes)
setIgnoredObjectTypes
in interface LifecyclePhase
public Class getLifecycleClass()
getLifecycleClass
in interface LifecyclePhase
public void setLifecycleClass(Class lifecycleClass)
setLifecycleClass
in interface LifecyclePhase
public String getName()
getName
in interface LifecyclePhase
public Set getSupportedPhases()
getSupportedPhases
in interface LifecyclePhase
public void setSupportedPhases(Set supportedPhases)
setSupportedPhases
in interface LifecyclePhase
public void registerSupportedPhase(String phase)
registerSupportedPhase
in interface LifecyclePhase
public boolean isPhaseSupported(String phase)
isPhaseSupported
in interface LifecyclePhase
public void applyLifecycle(Object o) throws LifecycleException
applyLifecycle
in interface LifecyclePhase
LifecycleException
public int getRegistryScope()
getRegistryScope
in interface LifecyclePhase
public void setRegistryScope(int registryScope)
setRegistryScope
in interface LifecyclePhase
public String getOppositeLifecyclePhase()
getOppositeLifecyclePhase
in interface LifecyclePhase
Copyright © 2003–2013 MuleSource, Inc.. All rights reserved.