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.slf4j.Logger |
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) |
Class<?>[] |
getIgnoredObjectTypes() |
Class<?> |
getLifecycleClass() |
String |
getName() |
String |
getOppositeLifecyclePhase() |
Set<LifecycleObject> |
getOrderedLifecycleObjects() |
Set<String> |
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<LifecycleObject> orderedLifecycleObjects) |
void |
setSupportedPhases(Set<String> supportedPhases) |
protected List<?> |
sortLifecycleInstances(Collection<?> objects,
LifecycleObject lo)
Subclasses can override this method to order
objects before the lifecycle method is applied to them. |
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 LifecyclePhasepublic void removeOrderedLifecycleObject(LifecycleObject lco)
removeOrderedLifecycleObject in interface LifecyclePhaseprotected boolean ignoreType(Class<?> type)
public Set<LifecycleObject> getOrderedLifecycleObjects()
getOrderedLifecycleObjects in interface LifecyclePhasepublic void setOrderedLifecycleObjects(Set<LifecycleObject> 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 org.mule.runtime.api.meta.NamedObjectpublic Set<String> getSupportedPhases()
getSupportedPhases in interface LifecyclePhasepublic void setSupportedPhases(Set<String> 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 org.mule.runtime.api.lifecycle.LifecycleException
applyLifecycle in interface LifecyclePhaseorg.mule.runtime.api.lifecycle.LifecycleExceptionpublic String getOppositeLifecyclePhase()
getOppositeLifecyclePhase in interface LifecyclePhaseCopyright © 2003–2017 MuleSoft, Inc.. All rights reserved.