public class DefaultLifecyclePhase extends Object implements LifecyclePhase, MuleContextAware
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 Log |
logger |
ALL_PHASES
Constructor and Description |
---|
DefaultLifecyclePhase(String name,
Class<?> lifecycleClass,
String oppositeLifecyclePhase) |
protected final transient Log logger
public void setMuleContext(MuleContext context)
setMuleContext
in interface MuleContextAware
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<LifecycleObject> getOrderedLifecycleObjects()
getOrderedLifecycleObjects
in interface LifecyclePhase
public void setOrderedLifecycleObjects(Set<LifecycleObject> 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()
NamedObject
getName
in interface NamedObject
public Set<String> getSupportedPhases()
getSupportedPhases
in interface LifecyclePhase
public void setSupportedPhases(Set<String> 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 String getOppositeLifecyclePhase()
getOppositeLifecyclePhase
in interface LifecyclePhase
Copyright © 2003–2015 MuleSoft, Inc.. All rights reserved.