public interface LifecycleRegistry extends Registry
Registry which not only registers and fetches objects, but it's also capable of applying lifecycle and injects
dependencies| Modifier and Type | Method and Description |
|---|---|
Object |
applyLifecycle(Object object)
Will fire any lifecycle methods according to the current lifecycle without actually registering the object in the registry.
|
Object |
applyLifecycle(Object object,
String phase)
Will fire the given lifecycle
phase without actually registering the object in the registry. |
void |
applyLifecycle(Object object,
String startPhase,
String toPhase)
Applies lifecycle phase to an object independent of the current lifecycle phase.
|
<T> T |
lookupObject(String key,
boolean applyLifecycle)
Look up a single object by name.
|
fireLifecycle, get, getRegistryId, isReadOnly, isRemote, lookupByType, lookupLocalObjects, lookupObject, lookupObject, lookupObjects, lookupObjectsForLifecycle, registerObject, registerObject, registerObjects, unregisterObject, unregisterObjectObject applyLifecycle(Object object) throws org.mule.runtime.api.exception.MuleException
object - the object to processorg.mule.runtime.api.exception.MuleException - if the registry fails to perform the lifecycle change for the object.Object applyLifecycle(Object object, String phase) throws org.mule.runtime.api.exception.MuleException
phase without actually registering the object in the registry. This is useful for
prototype objects that are created per request and would clutter the registry with single use objects.object - the object to processphase - the specific lifecycle phase you want to fireorg.mule.runtime.api.exception.MuleException - if the registry fails to perform the lifecycle change for the object.void applyLifecycle(Object object, String startPhase, String toPhase) throws org.mule.runtime.api.exception.MuleException
startPhase
and the endPhase will be executed.object - the object to apply lifecycle tostartPhase - the lifecycle phase the object is currently in. Must not be null.toPhase - the lifecycle phase to transition the object to. Must not be null.org.mule.runtime.api.exception.MuleException - if there is an exception while invoking lifecycle on the object<T> T lookupObject(String key, boolean applyLifecycle)
Registry.lookupObject(String) will return objects which had lifecycle phases applied,this method exists for cases in
which you want to specify that lifecycle is not to be applied. The actual semantics of that actually depends on the
implementation, since invoking this method might return a new instance or an already existing one. If an existing one is
returned, then the lifecycle might have been previously applied regardless.key - the key of the object you're looking forapplyLifecycle - if lifecycle should be applied to the returned object. Passing true doesn't guarantee that the
lifecycle is appliednull if not foundCopyright © 2003–2017 MuleSoft, Inc.. All rights reserved.