org.mule.lifecycle
Class DefaultLifecyclePhase
java.lang.Object
org.mule.lifecycle.DefaultLifecyclePhase
- All Implemented Interfaces:
- MuleContextAware, LifecyclePhase
- Direct Known Subclasses:
- ContainerManagedLifecyclePhase, MuleContextDisposePhase, MuleContextStartPhase, MuleContextStopPhase, NotInLifecyclePhase
public class DefaultLifecyclePhase
- extends 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
| 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(String name,
Class<?> lifecycleClass,
String oppositeLifecyclePhase)
setMuleContext
public void setMuleContext(MuleContext context)
- Specified by:
setMuleContext in interface MuleContextAware
applyLifecycle
public void applyLifecycle(Registry registry)
throws MuleException
- Specified by:
applyLifecycle in interface LifecyclePhase
- Throws:
MuleException
sortLifecycleInstances
protected List sortLifecycleInstances(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(Class<?> type)
getOrderedLifecycleObjects
public Set<LifecycleObject> getOrderedLifecycleObjects()
- Specified by:
getOrderedLifecycleObjects in interface LifecyclePhase
setOrderedLifecycleObjects
public void setOrderedLifecycleObjects(Set<LifecycleObject> orderedLifecycleObjects)
- Specified by:
setOrderedLifecycleObjects in interface LifecyclePhase
getIgnoredObjectTypes
public Class<?>[] getIgnoredObjectTypes()
- Specified by:
getIgnoredObjectTypes in interface LifecyclePhase
setIgnoredObjectTypes
public void setIgnoredObjectTypes(Class<?>[] ignorredObjectTypes)
- Specified by:
setIgnoredObjectTypes in interface LifecyclePhase
getLifecycleClass
public Class<?> getLifecycleClass()
- Specified by:
getLifecycleClass in interface LifecyclePhase
setLifecycleClass
public void setLifecycleClass(Class<?> lifecycleClass)
- Specified by:
setLifecycleClass in interface LifecyclePhase
getName
public String getName()
- Specified by:
getName in interface LifecyclePhase
getSupportedPhases
public Set<String> getSupportedPhases()
- Specified by:
getSupportedPhases in interface LifecyclePhase
setSupportedPhases
public void setSupportedPhases(Set<String> supportedPhases)
- Specified by:
setSupportedPhases in interface LifecyclePhase
registerSupportedPhase
public void registerSupportedPhase(String phase)
- Specified by:
registerSupportedPhase in interface LifecyclePhase
isPhaseSupported
public boolean isPhaseSupported(String phase)
- Specified by:
isPhaseSupported in interface LifecyclePhase
applyLifecycle
public void applyLifecycle(Object o)
throws LifecycleException
- Specified by:
applyLifecycle in interface LifecyclePhase
- Throws:
LifecycleException
getOppositeLifecyclePhase
public String getOppositeLifecyclePhase()
- Specified by:
getOppositeLifecyclePhase in interface LifecyclePhase
Copyright © 2003-2009 MuleSource, Inc.. All Rights Reserved.