|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.mule.registry.MuleRegistryHelper
public class MuleRegistryHelper
Adds lookup/register/unregister methods for Mule-specific entities to the standard Registry interface.
| Field Summary | |
|---|---|
protected Log |
logger
|
protected Map<String,List<Transformer>> |
transformerListCache
|
| Fields inherited from interface org.mule.api.registry.MuleRegistry |
|---|
LIFECYCLE_BYPASS_FLAG |
| 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(DefaultRegistryBroker registry)
|
|
| Method Summary | ||
|---|---|---|
Object |
applyLifecycle(Object object)
Will execute any lifecycle phases on an object without actually registering the object in the registry. |
|
Object |
applyProcessors(Object object)
Will execute any processors on an object without actually registering the object in the registry. |
|
Object |
applyProcessorsAndLifecycle(Object object)
Will execute any processors on an object and fire any lifecycle methods according to the current lifecycle without actually registering the object in the registry. |
|
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<Agent> |
getAgents()
|
|
Collection<Connector> |
getConnectors()
|
|
Collection<ImmutableEndpoint> |
getEndpoints()
|
|
Collection<Model> |
getModels()
|
|
protected String |
getName(Object obj)
|
|
String |
getRegistryId()
|
|
Collection<Transformer> |
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. |
|
|
lookupObjects(Class<T> 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<Service> |
lookupServices()
|
|
Collection<Service> |
lookupServices(String model)
|
|
Model |
lookupSystemModel()
|
|
Transformer |
lookupTransformer(Class inputType,
Class outputType)
Deprecated. |
|
Transformer |
lookupTransformer(DataType source,
DataType result)
Will find a transformer that is the closest match to the desired input and output. |
|
Transformer |
lookupTransformer(String name)
|
|
List<Transformer> |
lookupTransformers(Class input,
Class output)
Deprecated. |
|
List<Transformer> |
lookupTransformers(DataType source,
DataType result)
This method will return a list of Transformer objects that accept the given
input and return the given output type of object |
|
protected void |
notifyTransformerResolvers(Transformer t,
TransformerResolver.RegistryAction action)
|
|
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<String,List<Transformer>> transformerListCache
protected transient Log logger
| Constructor Detail |
|---|
public MuleRegistryHelper(DefaultRegistryBroker registry)
| Method Detail |
|---|
public 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 shutdown
RecoverableException - if an error occurs that can be recovered frompublic void dispose()
Disposable
dispose in interface Disposablepublic Connector lookupConnector(String name)
lookupConnector in interface MuleRegistrypublic 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 MuleRegistrypublic EndpointFactory lookupEndpointFactory()
lookupEndpointFactory in interface MuleRegistrypublic Transformer lookupTransformer(String name)
lookupTransformer in interface MuleRegistry
public Transformer lookupTransformer(Class inputType,
Class outputType)
throws TransformerException
lookupTransformer in interface MuleRegistryinputType - The desiered input type for the transformeroutputType - the desired output type for the transformer
TransformerException - will be thrown if there is more than one match
public List<Transformer> lookupTransformers(Class input,
Class output)
Transformer objects that accept the given
input and return the given output type of object
lookupTransformers in interface MuleRegistryinput - The desiered input type for the transformeroutput - the desired output type for the transformer
public Transformer lookupTransformer(DataType source,
DataType result)
throws TransformerException
lookupTransformer in interface MuleRegistrysource - The desiered input type for the transformerresult - the desired output type for the transformer
TransformerException - will be thrown if there is more than one match
public List<Transformer> lookupTransformers(DataType source,
DataType result)
Transformer objects that accept the given
input and return the given output type of object
lookupTransformers in interface MuleRegistrysource - The desired input type for the transformerresult - the desired output type for the transformer
public Model lookupModel(String name)
lookupModel in interface MuleRegistrypublic Model lookupSystemModel()
lookupSystemModel in interface MuleRegistrypublic Collection<Model> getModels()
getModels in interface MuleRegistrypublic Collection<Connector> getConnectors()
getConnectors in interface MuleRegistrypublic Collection<Agent> getAgents()
getAgents in interface MuleRegistrypublic Collection<ImmutableEndpoint> getEndpoints()
getEndpoints in interface MuleRegistrypublic Collection<Transformer> getTransformers()
getTransformers in interface MuleRegistrypublic Agent lookupAgent(String name)
lookupAgent in interface MuleRegistrypublic Service lookupService(String name)
lookupService in interface MuleRegistrypublic Collection<Service> lookupServices()
lookupServices in interface MuleRegistrypublic Collection<Service> lookupServices(String model)
lookupServices in interface MuleRegistry
public final void registerTransformer(Transformer transformer)
throws MuleException
registerTransformer in interface MuleRegistryMuleException
protected void notifyTransformerResolvers(Transformer t,
TransformerResolver.RegistryAction action)
public ServiceDescriptor lookupServiceDescriptor(String type,
String name,
Properties overrides)
throws ServiceException
lookupServiceDescriptor in interface MuleRegistryServiceException
protected ServiceDescriptor createServiceDescriptor(String type,
String name,
Properties overrides)
throws ServiceException
ServiceException
public void registerAgent(Agent agent)
throws MuleException
registerAgent in interface MuleRegistryMuleException
public void registerConnector(Connector connector)
throws MuleException
registerConnector in interface MuleRegistryMuleException
public void registerEndpoint(ImmutableEndpoint endpoint)
throws MuleException
registerEndpoint in interface MuleRegistryMuleException
public void registerEndpointBuilder(String name,
EndpointBuilder builder)
throws MuleException
registerEndpointBuilder in interface MuleRegistryMuleException
public void registerModel(Model model)
throws MuleException
registerModel in interface MuleRegistryMuleException
public void registerService(Service service)
throws MuleException
registerService in interface MuleRegistryMuleException
public void unregisterService(String serviceName)
throws MuleException
unregisterService in interface MuleRegistryMuleException
public void unregisterAgent(String agentName)
throws MuleException
unregisterAgent in interface MuleRegistryMuleException
public void unregisterConnector(String connectorName)
throws MuleException
unregisterConnector in interface MuleRegistryMuleException
public void unregisterEndpoint(String endpointName)
throws MuleException
unregisterEndpoint in interface MuleRegistryMuleException
public void unregisterModel(String modelName)
throws MuleException
unregisterModel in interface MuleRegistryMuleException
public void unregisterTransformer(String transformerName)
throws MuleException
unregisterTransformer in interface MuleRegistryMuleException
public Object applyProcessorsAndLifecycle(Object object)
throws MuleException
applyProcessorsAndLifecycle in interface MuleRegistryobject - the object to process
MuleException - if the registry fails to perform the lifecycle change or process object processors for the object.
public Object applyProcessors(Object object)
throws MuleException
MuleRegistry
applyProcessors in interface MuleRegistryobject - the object to process
MuleException - if the registry fails to process object processors for the object.
public Object applyLifecycle(Object object)
throws MuleException
MuleRegistry
applyLifecycle in interface MuleRegistryobject - the object to apply the current lifecycle state to
MuleException - if the registry fails to execute a lifecycle method.
public Object lookupObject(Class type)
throws RegistrationException
Registry
lookupObject in interface RegistryRegistrationException - if more than one object is found.public Object lookupObject(String key)
Registry
lookupObject in interface Registrypublic <T> Collection<T> lookupObjects(Class<T> type)
Registry
lookupObjects in interface Registry
public void registerObject(String key,
Object value,
Object metadata)
throws RegistrationException
registerObject in interface RegistryRegistrationException
public void registerObject(String key,
Object value)
throws RegistrationException
registerObject in interface RegistryRegistrationException
public void registerObjects(Map objects)
throws RegistrationException
registerObjects in interface RegistryRegistrationException
public void unregisterObject(String key,
Object metadata)
throws RegistrationException
unregisterObject in interface RegistryRegistrationException
public void unregisterObject(String key)
throws RegistrationException
unregisterObject in interface RegistryRegistrationExceptionprotected String getName(Object obj)
public String getRegistryId()
getRegistryId in interface Registrypublic boolean isReadOnly()
isReadOnly in interface Registrypublic boolean isRemote()
isRemote in interface Registry
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||