public abstract class AbstractRegistryBroker extends Object implements RegistryBroker
| Modifier and Type | Field and Description |
|---|---|
protected RegistryBrokerLifecycleManager |
lifecycleManager |
PHASE_NAMEPHASE_NAME| Constructor and Description |
|---|
AbstractRegistryBroker(MuleContext muleContext) |
| Modifier and Type | Method and Description |
|---|---|
void |
dispose()
A lifecycle method where implementor should free up any resources.
|
void |
fireLifecycle(String phase) |
<T> T |
get(String key)
Alias method performing the lookup, here to simplify syntax when called from dynamic languages.
|
protected abstract Collection<Registry> |
getRegistries() |
String |
getRegistryId() |
void |
initialise()
Method used to perform any initialisation work.
|
boolean |
isReadOnly() |
boolean |
isRemote() |
<T> Map<String,T> |
lookupByType(Class<T> type) |
<T> Collection<T> |
lookupLocalObjects(Class<T> type)
Look up all objects of a given type within the local registry.
|
<T> T |
lookupObject(Class<T> type)
Look up a single object by type.
|
<T> T |
lookupObject(String key)
Look up a single object by name.
|
<T> Collection<T> |
lookupObjects(Class<T> type)
Look up all objects of a given type.
|
<T> Collection<T> |
lookupObjectsForLifecycle(Class<T> type)
Look up all objects of a given type that lifecycle should be applied to.
|
void |
registerObject(String key,
Object value)
Registers an object in the registry with a key.
|
void |
registerObject(String key,
Object value,
Object metadata)
Registers an object in the registry with a key.
|
void |
registerObjects(Map objects)
Registers a Map of objects into the registry
|
void |
unregisterObject(String key)
Will remove an object by name from the registry.
|
void |
unregisterObject(String key,
Object metadata)
Will remove an object by name from the registry.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitaddRegistry, removeRegistryprotected RegistryBrokerLifecycleManager lifecycleManager
public AbstractRegistryBroker(MuleContext muleContext)
public void initialise()
throws InitialisationException
InitialisableInitialisationException 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 InitialisableInitialisationException - if a fatal error occurs causing the Mule instance to shutdownRecoverableException - if an error occurs that can be recovered frompublic void dispose()
Disposabledispose in interface Disposablepublic void fireLifecycle(String phase) throws LifecycleException
fireLifecycle in interface RegistryLifecycleExceptionpublic String getRegistryId()
getRegistryId in interface Registrypublic boolean isReadOnly()
isReadOnly in interface Registryprotected abstract Collection<Registry> getRegistries()
public <T> T get(String key)
Registrypublic <T> T lookupObject(String key)
RegistrylookupObject in interface Registrypublic <T> T lookupObject(Class<T> type) throws RegistrationException
RegistrylookupObject in interface RegistryRegistrationException - if more than one object is found.public <T> Collection<T> lookupObjects(Class<T> type)
RegistrylookupObjects in interface Registrypublic <T> Collection<T> lookupLocalObjects(Class<T> type)
RegistrylookupLocalObjects in interface Registrypublic <T> Map<String,T> lookupByType(Class<T> type)
lookupByType in interface Registrypublic <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 void registerObject(String key, Object value) throws RegistrationException
RegistryregisterObject in interface Registrykey - the key to store the value against. This is a non-null valuevalue - the object to store in the registry. This is a non-null valueRegistrationException - if an object with the same key already existspublic void registerObject(String key, Object value, Object metadata) throws RegistrationException
RegistryregisterObject in interface Registrykey - the key to store the value against. This is a non-null valuevalue - the object to store in the registry. This is a non-null valuemetadata - an implementation specific argument that can be passed into the methodRegistrationException - if an object with the same key already existspublic void registerObjects(Map objects) throws RegistrationException
RegistryregisterObjects in interface Registryobjects - a map of key value pairs, each will individually be registered in the registryRegistrationException - if an object with the same key already existspublic void unregisterObject(String key) throws RegistrationException
RegistryunregisterObject in interface Registrykey - the name or key of the object to remove from the registryRegistrationException - if there is a problem unregistering the object. Typically this will be because
the object's lifecycle threw an exceptionpublic void unregisterObject(String key, Object metadata) throws RegistrationException
RegistryunregisterObject 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 exceptionCopyright © 2003–2015 MuleSoft, Inc.. All rights reserved.