public abstract class AbstractRegistry extends Object implements Registry
| Modifier and Type | Field and Description |
|---|---|
protected Map |
exactTransformerCache |
protected LifecycleManager |
lifecycleManager |
protected org.apache.commons.logging.Log |
logger |
protected Map |
transformerListCache |
DEFAULT_SCOPE, SCOPE_IMMEDIATE, SCOPE_LOCAL, SCOPE_REMOTEPHASE_NAMEPHASE_NAME| Modifier | Constructor and Description |
|---|---|
protected |
AbstractRegistry(String id)
Default Constructor
|
protected |
AbstractRegistry(String id,
Registry parent) |
| Modifier and Type | Method and Description |
|---|---|
protected abstract LifecycleManager |
createLifecycleManager() |
void |
dispose()
A lifecycle method where implementor should free up any resources.
|
protected void |
doDispose() |
protected void |
doInitialise() |
protected abstract Object |
doLookupObject(String key) |
protected abstract Collection |
doLookupObjects(Class type) |
protected abstract void |
doRegisterObject(String key,
Object value,
Object metadata) |
protected abstract void |
doRegisterTransformer(Transformer transformer) |
Collection |
getAgents() |
Collection |
getConnectors() |
int |
getDefaultScope() |
Collection |
getEndpoints() |
protected LifecycleManager |
getLifecycleManager() |
Collection |
getModels() |
protected Transformer |
getNearestTransformerMatch(List trans,
Class input,
Class output) |
Registry |
getParent() |
String |
getRegistryId() |
Collection |
getTransformers() |
void |
initialise()
Method used to perform any initialisation work.
|
boolean |
isDisposed() |
boolean |
isDisposing() |
boolean |
isInitialised() |
boolean |
isInitialising() |
Agent |
lookupAgent(String name) |
Connector |
lookupConnector(String name) |
ImmutableEndpoint |
lookupEndpoint(String name)
Removed this method from
Registry API as it should only be used
internally and may confuse users. |
EndpointBuilder |
lookupEndpointBuilder(String name)
Looks-up endpoint builders which can be used to repeatably create endpoints with the same configuration.
|
EndpointFactory |
lookupEndpointFactory() |
Model |
lookupModel(String name) |
Object |
lookupObject(Class type)
Look up a single object by type.
|
Object |
lookupObject(Class type,
int scope)
Look up a single object by type.
|
Object |
lookupObject(String key)
Look up a single object by name.
|
Object |
lookupObject(String key,
int scope)
Look up a single object by name.
|
Collection |
lookupObjects(Class type)
Look up all objects of a given type.
|
Collection |
lookupObjects(Class type,
int scope)
Look up all objects of a given type.
|
Service |
lookupService(String name) |
Collection |
lookupServices() |
Collection |
lookupServices(String model) |
Model |
lookupSystemModel() |
Transformer |
lookupTransformer(Class inputType,
Class outputType)
Will find a transformer that is the closest match to the desired input and output.
|
Transformer |
lookupTransformer(String name) |
List |
lookupTransformers(Class input,
Class output)
This method will return a list of
Transformer objects that accept the given
input and return the given output type of object |
void |
registerObject(String key,
Object value) |
void |
registerObject(String key,
Object value,
Object metadata) |
void |
registerTransformer(Transformer transformer) |
void |
setDefaultScope(int scope) |
void |
setParent(Registry registry) |
protected void |
unsupportedOperation(String operation,
Object o) |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitisReadOnly, isRemote, lookupServiceDescriptor, registerAgent, registerConnector, registerEndpoint, registerEndpointBuilder, registerModel, registerObjects, registerService, unregisterAgent, unregisterConnector, unregisterEndpoint, unregisterModel, unregisterObject, unregisterService, unregisterTransformerprotected transient org.apache.commons.logging.Log logger
protected LifecycleManager lifecycleManager
protected Map transformerListCache
protected Map exactTransformerCache
protected AbstractRegistry(String id)
protected abstract LifecycleManager createLifecycleManager()
protected LifecycleManager getLifecycleManager()
public final void dispose()
Disposabledispose in interface Disposableprotected void doDispose()
public boolean isDisposed()
isDisposed in interface Registrypublic boolean isDisposing()
isDisposing in interface Registrypublic boolean isInitialised()
isInitialised in interface Registrypublic boolean isInitialising()
isInitialising in interface Registrypublic final 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 fromprotected void doInitialise()
throws InitialisationException
InitialisationExceptionpublic Connector lookupConnector(String name)
lookupConnector in interface Registrypublic ImmutableEndpoint lookupEndpoint(String name)
Registry API as it should only be used
internally and may confuse users. The EndpointFactory should be used
for creating endpoints.name - the idendtifer/name used to register endpoint in registry#lookupInboundEndpoint(String, org.mule.api.MuleContext),
#lookupResponseEndpoint(String, org.mule.api.MuleContext)public EndpointBuilder lookupEndpointBuilder(String name)
RegistrylookupEndpointBuilder in interface Registrypublic EndpointFactory lookupEndpointFactory()
lookupEndpointFactory in interface Registrypublic Transformer lookupTransformer(String name)
lookupTransformer in interface Registrypublic Transformer lookupTransformer(Class inputType, Class outputType) throws TransformerException
lookupTransformer in interface RegistryinputType - The desiered input type for the transformeroutputType - the desired output type for the transformerTransformerException - will be thrown if there is more than one matchprotected Transformer getNearestTransformerMatch(List trans, Class input, Class output) throws TransformerException
TransformerExceptionpublic List lookupTransformers(Class input, Class output)
Transformer objects that accept the given
input and return the given output type of objectlookupTransformers in interface Registryinput - The desiered input type for the transformeroutput - the desired output type for the transformerpublic Model lookupModel(String name)
lookupModel in interface Registrypublic Model lookupSystemModel()
lookupSystemModel in interface Registrypublic Collection getModels()
public Collection getConnectors()
getConnectors in interface Registrypublic Collection getAgents()
public Collection getEndpoints()
getEndpoints in interface Registrypublic Collection getTransformers()
getTransformers in interface Registrypublic Agent lookupAgent(String name)
lookupAgent in interface Registrypublic Service lookupService(String name)
lookupService in interface Registrypublic Collection lookupServices()
lookupServices in interface Registrypublic Collection lookupServices(String model)
lookupServices in interface Registrypublic final Object lookupObject(String key, int scope)
RegistrylookupObject in interface Registrypublic final Object lookupObject(Class type) throws RegistrationException
RegistrylookupObject in interface RegistryRegistrationExceptionpublic final Object lookupObject(Class type, int scope) throws RegistrationException
lookupObject in interface RegistryRegistrationException - if more than one object is foundpublic final Collection lookupObjects(Class type)
RegistrylookupObjects in interface Registrypublic final Collection lookupObjects(Class type, int scope)
RegistrylookupObjects in interface Registryprotected abstract Collection doLookupObjects(Class type)
public Object lookupObject(String key)
RegistrylookupObject in interface Registryprotected abstract Object doLookupObject(String key)
protected void unsupportedOperation(String operation, Object o) throws UnsupportedOperationException
UnsupportedOperationExceptionpublic final void registerObject(String key, Object value) throws RegistrationException
registerObject in interface RegistryRegistrationExceptionpublic final void registerObject(String key, Object value, Object metadata) throws RegistrationException
registerObject in interface RegistryRegistrationExceptionprotected abstract void doRegisterObject(String key, Object value, Object metadata) throws RegistrationException
RegistrationExceptionpublic final void registerTransformer(Transformer transformer) throws MuleException
registerTransformer in interface RegistryMuleExceptionprotected abstract void doRegisterTransformer(Transformer transformer) throws MuleException
MuleExceptionpublic final String getRegistryId()
getRegistryId in interface Registrypublic int getDefaultScope()
getDefaultScope in interface Registrypublic void setDefaultScope(int scope)
setDefaultScope in interface RegistryCopyright © 2003-2012 MuleSource, Inc.. All Rights Reserved.