public interface Registry extends Initialisable, Disposable
PHASE_NAME
PHASE_NAME
Modifier and Type | Method and Description |
---|---|
void |
fireLifecycle(String phase) |
<T> T |
get(String key)
Alias method performing the lookup, here to simplify syntax when called from dynamic languages.
|
String |
getRegistryId() |
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> clazz)
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)
Deprecated.
as of 3.7.0. Use
registerObject(String, Object) instead |
void |
registerObjects(Map<String,Object> objects)
Registers a Map of objects into the registry
|
Object |
unregisterObject(String key)
Will remove an object by name from the registry.
|
Object |
unregisterObject(String key,
Object metadata)
Deprecated.
as of 3.7.0. Use
unregisterObject(String) instead |
initialise
dispose
<T> T get(String key)
<T> T lookupObject(String key)
<T> Collection<T> lookupObjects(Class<T> type)
<T> Collection<T> lookupLocalObjects(Class<T> type)
<T> Collection<T> lookupObjectsForLifecycle(Class<T> type)
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.<T> T lookupObject(Class<T> clazz) throws RegistrationException
RegistrationException
- if more than one object is found.void registerObject(String key, Object value) throws RegistrationException
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 void registerObject(String key, Object value, Object metadata) throws RegistrationException
registerObject(String, Object)
insteadkey
- 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 existsvoid registerObjects(Map<String,Object> objects) throws RegistrationException
objects
- a map of key value pairs, each will individually be registered in the registryRegistrationException
- if an object with the same key already existsObject unregisterObject(String key) throws RegistrationException
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 Object unregisterObject(String key, Object metadata) throws RegistrationException
unregisterObject(String)
insteadkey
- 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 exceptionRegistrationException
- if there is a problem unregistering the object. Typically this will be because
the object's lifecycle threw an exceptionString getRegistryId()
void fireLifecycle(String phase) throws LifecycleException
LifecycleException
boolean isReadOnly()
boolean isRemote()
Copyright © 2003–2016 MuleSoft, Inc.. All rights reserved.