public abstract class AbstractRegistry extends Object implements Registry
Modifier and Type | Field and Description |
---|---|
protected RegistryLifecycleManager |
lifecycleManager |
protected Log |
logger |
protected MuleContext |
muleContext |
PHASE_NAME
PHASE_NAME
Modifier | Constructor and Description |
---|---|
protected |
AbstractRegistry(String id,
MuleContext muleContext) |
Modifier and Type | Method and Description |
---|---|
protected RegistryLifecycleManager |
createLifecycleManager() |
void |
dispose()
A lifecycle method where implementor should free up any resources.
|
protected abstract void |
doDispose() |
protected abstract void |
doInitialise() |
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()
Method used to perform any initialisation work.
|
<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.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
isReadOnly, isRemote, lookupByType, lookupLocalObjects, lookupObject, lookupObjects, registerObject, registerObject, registerObjects, unregisterObject, unregisterObject
protected transient Log logger
protected MuleContext muleContext
protected RegistryLifecycleManager lifecycleManager
protected AbstractRegistry(String id, MuleContext muleContext)
public final void dispose()
Disposable
dispose
in interface Disposable
protected RegistryLifecycleManager createLifecycleManager()
protected abstract void doInitialise() throws InitialisationException
InitialisationException
protected abstract void doDispose()
public final void initialise() throws InitialisationException
Initialisable
InitialisationException
should be thrown,
causing the Mule instance to shutdown. If the error is recoverable, say by
retrying to connect, a RecoverableException
should be thrown.
There is no guarantee that by throwing a Recoverable exception that the Mule
instance will not shut down.initialise
in interface Initialisable
InitialisationException
- if a fatal error occurs causing the Mule instance to shutdownRecoverableException
- if an error occurs that can be recovered frompublic RegistryLifecycleManager getLifecycleManager()
public void fireLifecycle(String phase) throws LifecycleException
fireLifecycle
in interface Registry
LifecycleException
public <T> T get(String key)
Registry
public <T> T lookupObject(Class<T> type) throws RegistrationException
Registry
lookupObject
in interface Registry
RegistrationException
- if more than one object is found.public <T> Collection<T> lookupObjectsForLifecycle(Class<T> type)
Registry
Registry.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 Registry
public final String getRegistryId()
getRegistryId
in interface Registry
Copyright © 2003–2015 MuleSoft, Inc.. All rights reserved.