org.mule.lifecycle.phases
Class DefaultLifecyclePhase
java.lang.Object
org.mule.lifecycle.phases.DefaultLifecyclePhase
- All Implemented Interfaces:
- MuleContextAware, LifecyclePhase
- Direct Known Subclasses:
- ContainerManagedLifecyclePhase, MuleContextDisposePhase, MuleContextInitialisePhase, MuleContextStartPhase, MuleContextStopPhase, NotInLifecyclePhase, PausePhase, ResumePhase
public class DefaultLifecyclePhase
- extends java.lang.Object
- implements LifecyclePhase, MuleContextAware
Represents a configurable lifecycle phase. This is a default implementation of a
'generic phase' in that is can be configured to represnt any phase. Instances of
this phase can then be registered with a
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
.
- See Also:
LifecyclePhase
Constructor Summary |
DefaultLifecyclePhase(java.lang.String name,
java.lang.Class<?> lifecycleClass,
java.lang.String oppositeLifecyclePhase)
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
logger
protected final transient Log logger
DefaultLifecyclePhase
public DefaultLifecyclePhase(java.lang.String name,
java.lang.Class<?> lifecycleClass,
java.lang.String oppositeLifecyclePhase)
setMuleContext
public void setMuleContext(MuleContext context)
- Specified by:
setMuleContext
in interface MuleContextAware
sortLifecycleInstances
protected java.util.List sortLifecycleInstances(java.util.Collection objects,
LifecycleObject lo)
- Subclasses can override this method to order
objects
before the
lifecycle method is applied to them. This method does not apply any special
ordering to objects
.
- Parameters:
objects
- lo
-
- Returns:
- List with ordered objects
addOrderedLifecycleObject
public void addOrderedLifecycleObject(LifecycleObject lco)
- Specified by:
addOrderedLifecycleObject
in interface LifecyclePhase
removeOrderedLifecycleObject
public void removeOrderedLifecycleObject(LifecycleObject lco)
- Specified by:
removeOrderedLifecycleObject
in interface LifecyclePhase
ignoreType
protected boolean ignoreType(java.lang.Class<?> type)
getOrderedLifecycleObjects
public java.util.Set<LifecycleObject> getOrderedLifecycleObjects()
- Specified by:
getOrderedLifecycleObjects
in interface LifecyclePhase
setOrderedLifecycleObjects
public void setOrderedLifecycleObjects(java.util.Set<LifecycleObject> orderedLifecycleObjects)
- Specified by:
setOrderedLifecycleObjects
in interface LifecyclePhase
getIgnoredObjectTypes
public java.lang.Class<?>[] getIgnoredObjectTypes()
- Specified by:
getIgnoredObjectTypes
in interface LifecyclePhase
setIgnoredObjectTypes
public void setIgnoredObjectTypes(java.lang.Class<?>[] ignorredObjectTypes)
- Specified by:
setIgnoredObjectTypes
in interface LifecyclePhase
getLifecycleClass
public java.lang.Class<?> getLifecycleClass()
- Specified by:
getLifecycleClass
in interface LifecyclePhase
setLifecycleClass
public void setLifecycleClass(java.lang.Class<?> lifecycleClass)
- Specified by:
setLifecycleClass
in interface LifecyclePhase
getName
public java.lang.String getName()
- Specified by:
getName
in interface LifecyclePhase
getSupportedPhases
public java.util.Set<java.lang.String> getSupportedPhases()
- Specified by:
getSupportedPhases
in interface LifecyclePhase
setSupportedPhases
public void setSupportedPhases(java.util.Set<java.lang.String> supportedPhases)
- Specified by:
setSupportedPhases
in interface LifecyclePhase
registerSupportedPhase
public void registerSupportedPhase(java.lang.String phase)
- Specified by:
registerSupportedPhase
in interface LifecyclePhase
isPhaseSupported
public boolean isPhaseSupported(java.lang.String phase)
- Specified by:
isPhaseSupported
in interface LifecyclePhase
applyLifecycle
public void applyLifecycle(java.lang.Object o)
throws LifecycleException
- Specified by:
applyLifecycle
in interface LifecyclePhase
- Throws:
LifecycleException
getOppositeLifecyclePhase
public java.lang.String getOppositeLifecyclePhase()
- Specified by:
getOppositeLifecyclePhase
in interface LifecyclePhase
Copyright © 2003-2010 MuleSoft, Inc.. All Rights Reserved.