public abstract class AbstractRegistry extends Object implements Registry
| Modifier and Type | Field and Description |
|---|---|
protected RegistryLifecycleManager |
lifecycleManager |
protected org.slf4j.Logger |
logger |
protected MuleContext |
muleContext |
| Modifier | Constructor and Description |
|---|---|
protected |
AbstractRegistry(String id,
MuleContext muleContext) |
| Modifier and Type | Method and Description |
|---|---|
protected RegistryLifecycleManager |
createLifecycleManager() |
void |
dispose() |
protected abstract void |
doDispose() |
protected abstract void |
doInitialise() |
protected abstract Object |
doUnregisterObject(String key)
Template method for the logic to actually unregister the key without applying any lifecycle to it.
|
void |
fireLifecycle(String phase) |
<T> T |
get(String key)
Alias method performing the lookup, here to simplify syntax when called from dynamic languages.
|
RegistryLifecycleManager |
getLifecycleManager() |
String |
getRegistryId() |
void |
initialise() |
protected boolean |
isInitialised() |
<T> T |
lookupObject(Class<T> type)
Look up a single object by type.
|
<T> Collection<T> |
lookupObjectsForLifecycle(Class<T> type)
Look up all objects of a given type that lifecycle should be applied to.
|
Object |
unregisterObject(String key)
Will remove an object by name from the registry.
|
Object |
unregisterObject(String key,
Object metadata)
Deprecated.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitisReadOnly, isRemote, lookupByType, lookupLocalObjects, lookupObject, lookupObjects, registerObject, registerObject, registerObjectsprotected transient org.slf4j.Logger logger
protected MuleContext muleContext
protected RegistryLifecycleManager lifecycleManager
protected AbstractRegistry(String id, MuleContext muleContext)
public final void dispose()
dispose in interface org.mule.runtime.api.lifecycle.Disposableprotected RegistryLifecycleManager createLifecycleManager()
protected abstract void doInitialise()
throws org.mule.runtime.api.lifecycle.InitialisationException
org.mule.runtime.api.lifecycle.InitialisationExceptionprotected abstract void doDispose()
public final void initialise()
throws org.mule.runtime.api.lifecycle.InitialisationException
initialise in interface org.mule.runtime.api.lifecycle.Initialisableorg.mule.runtime.api.lifecycle.InitialisationExceptionprotected boolean isInitialised()
public RegistryLifecycleManager getLifecycleManager()
public void fireLifecycle(String phase) throws org.mule.runtime.api.lifecycle.LifecycleException
fireLifecycle in interface Registryorg.mule.runtime.api.lifecycle.LifecycleExceptionpublic <T> T get(String key)
Registrypublic final Object unregisterObject(String key) throws RegistrationException
RegistryunregisterObject in interface Registrykey - the name or key of the object to remove from the registrynull if no object was registered under that keyRegistrationException - if there is a problem unregistering the object. Typically this will be because the object's
lifecycle threw an exception@Deprecated public final Object unregisterObject(String key, Object metadata) throws RegistrationException
unregisterObject in interface Registrykey - the name or key of the object to remove from the registrymetadata - an implementation specific argument that can be passed into the methodRegistrationException - if there is a problem unregistering the object. Typically this will be because the object's
lifecycle threw an exceptionprotected abstract Object doUnregisterObject(String key) throws RegistrationException
unregisterObject(String)key - the key of the object to be unregistered objectkeyRegistrationExceptionpublic <T> T lookupObject(Class<T> type) throws RegistrationException
RegistrylookupObject in interface RegistryRegistrationException - if more than one object is found.public <T> Collection<T> lookupObjectsForLifecycle(Class<T> type)
RegistryRegistry.lookupObjects(Class) in that it allows implementations to provide an alternative implementation of lookup for
lifecycle. For example only returning pre-existing objects and not creating new ones on the fly.lookupObjectsForLifecycle in interface Registrypublic final String getRegistryId()
getRegistryId in interface RegistryCopyright © 2003–2017 MuleSoft, Inc.. All rights reserved.