@Deprecated public abstract class AbstractRegistryBroker extends Object implements RegistryBroker, RegistryProvider
Modifier and Type | Field and Description |
---|---|
protected RegistryBrokerLifecycleManager |
lifecycleManager
Deprecated.
|
PHASE_NAME
PHASE_NAME
Constructor and Description |
---|
AbstractRegistryBroker(MuleContext muleContext)
Deprecated.
|
Modifier and Type | Method and Description |
---|---|
void |
dispose()
Deprecated.
A lifecycle method where implementor should free up any resources.
|
void |
fireLifecycle(String phase)
Deprecated.
|
<T> T |
get(String key)
Deprecated.
Alias method performing the lookup, here to simplify syntax when called from dynamic languages.
|
String |
getRegistryId()
Deprecated.
|
void |
initialise()
Deprecated.
Method used to perform any initialisation work.
|
boolean |
isReadOnly()
Deprecated.
|
boolean |
isRemote()
Deprecated.
|
<T> Map<String,T> |
lookupByType(Class<T> type)
Deprecated.
|
<T> Collection<T> |
lookupLocalObjects(Class<T> type)
Deprecated.
Look up all objects of a given type within the local registry.
|
<T> T |
lookupObject(Class<T> type)
Deprecated.
Look up a single object by type.
|
<T> T |
lookupObject(String key)
Deprecated.
Look up a single object by name.
|
<T> T |
lookupObject(String key,
boolean applyLifecycle)
Deprecated.
Iterates through
RegistryProvider.getRegistries() trying to
find the first one which is an instance of
LifecycleRegistry . |
<T> Collection<T> |
lookupObjects(Class<T> type)
Deprecated.
Look up all objects of a given type.
|
<T> Collection<T> |
lookupObjectsForLifecycle(Class<T> type)
Deprecated.
Look up all objects of a given type that lifecycle should be applied to.
|
void |
registerObject(String key,
Object value)
Deprecated.
Registers an object in the registry with a key.
|
void |
registerObject(String key,
Object value,
Object metadata)
Deprecated.
|
void |
registerObjects(Map objects)
Deprecated.
Registers a Map of objects into the registry
|
Object |
unregisterObject(String key)
Deprecated.
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, wait
addRegistry, removeRegistry
getRegistries
protected RegistryBrokerLifecycleManager lifecycleManager
public AbstractRegistryBroker(MuleContext muleContext)
public 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 void dispose()
Disposable
dispose
in interface Disposable
public void fireLifecycle(String phase) throws LifecycleException
fireLifecycle
in interface Registry
LifecycleException
public String getRegistryId()
getRegistryId
in interface Registry
public boolean isReadOnly()
isReadOnly
in interface Registry
public <T> T get(String key)
Registry
public <T> T lookupObject(String key)
Registry
lookupObject
in interface Registry
public <T> T lookupObject(String key, boolean applyLifecycle)
RegistryProvider.getRegistries()
trying to
find the first one which is an instance of
LifecycleRegistry
. When found, it returns
the result of LifecycleRegistry.lookupObject(String, boolean)
.
If none of the available registries is of that type, then it
fallbacks to lookupObject(String)
T
- the type of the expected objectkey
- the key of the object you're looking forapplyLifecycle
- whether lifecycle should be applied to the object before returningkey
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> lookupObjects(Class<T> type)
Registry
lookupObjects
in interface Registry
public <T> Collection<T> lookupLocalObjects(Class<T> type)
Registry
lookupLocalObjects
in interface Registry
public <T> Map<String,T> lookupByType(Class<T> type)
lookupByType
in interface Registry
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 void registerObject(String key, Object value) throws RegistrationException
registerObject
in interface Registry
key
- 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 exists@Deprecated public void registerObject(String key, Object value, Object metadata) throws RegistrationException
registerObject
in interface Registry
key
- 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
registerObjects
in interface Registry
objects
- a map of key value pairs, each will individually be registered in the registryRegistrationException
- if an object with the same key already existspublic Object unregisterObject(String key) throws RegistrationException
unregisterObject
in interface Registry
key
- 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 Object unregisterObject(String key, Object metadata) throws RegistrationException
unregisterObject
in interface Registry
key
- 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.