|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.mule.registry.MuleRegistryHelper
public class MuleRegistryHelper
Adds lookup/register/unregister methods for Mule-specific entities to the standard Registry interface. TODO MULE-2228 "Java-based configuration mechanism for Mule 2.0" will extend/build upon this interface.
Field Summary | |
---|---|
protected Map |
exactTransformerCache
|
protected Log |
logger
|
protected Map |
transformerListCache
|
Fields inherited from interface org.mule.api.lifecycle.Initialisable |
---|
PHASE_NAME |
Fields inherited from interface org.mule.api.lifecycle.Disposable |
---|
PHASE_NAME |
Constructor Summary | |
---|---|
MuleRegistryHelper(Registry registry)
|
Method Summary | |
---|---|
protected ServiceDescriptor |
createServiceDescriptor(String type,
String name,
Properties overrides)
Deprecated. ServiceDescriptors will be created upon bundle startup for OSGi. |
void |
dispose()
A lifecycle method where implementor should free up any resources. |
Collection |
getAgents()
|
Collection |
getConnectors()
|
Collection |
getEndpoints()
|
Collection |
getModels()
|
protected String |
getName(Object obj)
|
protected Transformer |
getNearestTransformerMatch(List trans,
Class input,
Class output)
|
String |
getRegistryId()
|
Collection |
getTransformers()
|
void |
initialise()
Method used to perform any initialisation work. |
boolean |
isReadOnly()
|
boolean |
isRemote()
|
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(String key)
Look up a single object by name. |
Collection |
lookupObjects(Class type)
Look up all objects of a given type. |
Service |
lookupService(String name)
|
ServiceDescriptor |
lookupServiceDescriptor(String type,
String name,
Properties overrides)
Looks up the service descriptor from a singleton cache and creates a new one if not found. |
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 |
registerAgent(Agent agent)
|
void |
registerConnector(Connector connector)
|
void |
registerEndpoint(ImmutableEndpoint endpoint)
|
void |
registerEndpointBuilder(String name,
EndpointBuilder builder)
|
void |
registerModel(Model model)
|
void |
registerObject(String key,
Object value)
|
void |
registerObject(String key,
Object value,
Object metadata)
|
void |
registerObjects(Map objects)
|
void |
registerService(Service service)
|
void |
registerTransformer(Transformer transformer)
|
void |
unregisterAgent(String agentName)
|
void |
unregisterConnector(String connectorName)
|
void |
unregisterEndpoint(String endpointName)
|
void |
unregisterModel(String modelName)
|
void |
unregisterObject(String key)
|
void |
unregisterObject(String key,
Object metadata)
|
void |
unregisterService(String serviceName)
|
void |
unregisterTransformer(String transformerName)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected Map transformerListCache
protected Map exactTransformerCache
protected transient Log logger
Constructor Detail |
---|
public MuleRegistryHelper(Registry registry)
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 Connector lookupConnector(String name)
lookupConnector
in interface MuleRegistry
public 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 registrypublic EndpointBuilder lookupEndpointBuilder(String name)
MuleRegistry
lookupEndpointBuilder
in interface MuleRegistry
public EndpointFactory lookupEndpointFactory()
lookupEndpointFactory
in interface MuleRegistry
public Transformer lookupTransformer(String name)
lookupTransformer
in interface MuleRegistry
public Transformer lookupTransformer(Class inputType, Class outputType) throws TransformerException
lookupTransformer
in interface MuleRegistry
inputType
- The desiered input type for the transformeroutputType
- the desired output type for the transformer
TransformerException
- will be thrown if there is more than one matchprotected Transformer getNearestTransformerMatch(List trans, Class input, Class output) throws TransformerException
TransformerException
public List lookupTransformers(Class input, Class output)
Transformer
objects that accept the given
input and return the given output type of object
lookupTransformers
in interface MuleRegistry
input
- The desiered input type for the transformeroutput
- the desired output type for the transformer
public Model lookupModel(String name)
lookupModel
in interface MuleRegistry
public Model lookupSystemModel()
lookupSystemModel
in interface MuleRegistry
public Collection getModels()
getModels
in interface MuleRegistry
public Collection getConnectors()
getConnectors
in interface MuleRegistry
public Collection getAgents()
getAgents
in interface MuleRegistry
public Collection getEndpoints()
getEndpoints
in interface MuleRegistry
public Collection getTransformers()
getTransformers
in interface MuleRegistry
public Agent lookupAgent(String name)
lookupAgent
in interface MuleRegistry
public Service lookupService(String name)
lookupService
in interface MuleRegistry
public Collection lookupServices()
lookupServices
in interface MuleRegistry
public Collection lookupServices(String model)
lookupServices
in interface MuleRegistry
public final void registerTransformer(Transformer transformer) throws MuleException
registerTransformer
in interface MuleRegistry
MuleException
public ServiceDescriptor lookupServiceDescriptor(String type, String name, Properties overrides) throws ServiceException
lookupServiceDescriptor
in interface MuleRegistry
ServiceException
protected ServiceDescriptor createServiceDescriptor(String type, String name, Properties overrides) throws ServiceException
ServiceException
public void registerAgent(Agent agent) throws MuleException
registerAgent
in interface MuleRegistry
MuleException
public void registerConnector(Connector connector) throws MuleException
registerConnector
in interface MuleRegistry
MuleException
public void registerEndpoint(ImmutableEndpoint endpoint) throws MuleException
registerEndpoint
in interface MuleRegistry
MuleException
public void registerEndpointBuilder(String name, EndpointBuilder builder) throws MuleException
registerEndpointBuilder
in interface MuleRegistry
MuleException
public void registerModel(Model model) throws MuleException
registerModel
in interface MuleRegistry
MuleException
public void registerService(Service service) throws MuleException
registerService
in interface MuleRegistry
MuleException
public void unregisterService(String serviceName) throws MuleException
unregisterService
in interface MuleRegistry
MuleException
public void unregisterAgent(String agentName) throws MuleException
unregisterAgent
in interface MuleRegistry
MuleException
public void unregisterConnector(String connectorName) throws MuleException
unregisterConnector
in interface MuleRegistry
MuleException
public void unregisterEndpoint(String endpointName) throws MuleException
unregisterEndpoint
in interface MuleRegistry
MuleException
public void unregisterModel(String modelName) throws MuleException
unregisterModel
in interface MuleRegistry
MuleException
public void unregisterTransformer(String transformerName) throws MuleException
unregisterTransformer
in interface MuleRegistry
MuleException
public Object lookupObject(Class type) throws RegistrationException
Registry
lookupObject
in interface Registry
RegistrationException
- if more than one object is found.public Object lookupObject(String key)
Registry
lookupObject
in interface Registry
public Collection lookupObjects(Class type)
Registry
lookupObjects
in interface Registry
public void registerObject(String key, Object value, Object metadata) throws RegistrationException
registerObject
in interface Registry
RegistrationException
public void registerObject(String key, Object value) throws RegistrationException
registerObject
in interface Registry
RegistrationException
public void registerObjects(Map objects) throws RegistrationException
registerObjects
in interface Registry
RegistrationException
public void unregisterObject(String key, Object metadata) throws RegistrationException
unregisterObject
in interface Registry
RegistrationException
public void unregisterObject(String key) throws RegistrationException
unregisterObject
in interface Registry
RegistrationException
protected String getName(Object obj)
public String getRegistryId()
getRegistryId
in interface Registry
public boolean isReadOnly()
isReadOnly
in interface Registry
public boolean isRemote()
isRemote
in interface Registry
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |