|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.mule.registry.AbstractRegistryBroker
public abstract class AbstractRegistryBroker
Field Summary | |
---|---|
protected RegistryBrokerLifecycleManager |
lifecycleManager
|
Fields inherited from interface org.mule.api.lifecycle.Initialisable |
---|
PHASE_NAME |
Fields inherited from interface org.mule.api.lifecycle.Disposable |
---|
PHASE_NAME |
Constructor Summary | |
---|---|
AbstractRegistryBroker(MuleContext muleContext)
|
Method Summary | ||
---|---|---|
void |
dispose()
A lifecycle method where implementor should free up any resources. |
|
void |
fireLifecycle(String phase)
|
|
|
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()
|
|
|
lookupByType(Class<T> type)
|
|
|
lookupObject(Class<T> type)
Look up a single object by type. |
|
|
lookupObject(String key)
Look up a single object by name. |
|
|
lookupObjects(Class<T> type)
Look up all objects of a given type. |
|
|
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. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface org.mule.api.registry.RegistryBroker |
---|
addRegistry, removeRegistry |
Field Detail |
---|
protected RegistryBrokerLifecycleManager lifecycleManager
Constructor Detail |
---|
public AbstractRegistryBroker(MuleContext muleContext)
Method Detail |
---|
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 shutdown
RecoverableException
- 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 boolean isRemote()
isRemote
in interface Registry
protected abstract Collection<Registry> getRegistries()
public <T> T get(String key)
Registry
get
in interface Registry
public <T> T lookupObject(String key)
Registry
lookupObject
in interface 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> lookupObjects(Class<T> type)
Registry
lookupObjects
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
Registry
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 value
RegistrationException
- if an object with the same key already existspublic void registerObject(String key, Object value, Object metadata) throws RegistrationException
Registry
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 method
RegistrationException
- if an object with the same key already existspublic void registerObjects(Map objects) throws RegistrationException
Registry
registerObjects
in interface Registry
objects
- a map of key value pairs, each will individually be registered in the registry
RegistrationException
- if an object with the same key already existspublic void unregisterObject(String key) throws RegistrationException
Registry
unregisterObject
in interface Registry
key
- the name or key of the object to remove from the registry
RegistrationException
- 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
Registry
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 method
RegistrationException
- if there is a problem unregistering the object. Typically this will be because
the object's lifecycle threw an exception
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |