org.mule.api.registry
Interface MuleRegistry

All Superinterfaces:
Disposable, Initialisable, Registry
All Known Implementing Classes:
MuleRegistryHelper

public interface MuleRegistry
extends Registry

Adds lookup/register/unregister methods for Mule-specific entities to the standard Registry interface.


Field Summary
static int INJECT_PROCESSORS_BYPASS_FLAG
          Determines whether Inject processors should get executed on an object added to the registry Inject processors are responsible for processing inject interfaces such as MuleContextAware
static int LIFECYCLE_BYPASS_FLAG
          Pass this flag as metadata of the Registry.registerObject(String, Object, Object) method to have lifecycle method calls on the registered objects omitted.
static int PRE_INIT_PROCESSORS_BYPASS_FLAG
          Determines whether pre-init processors should get executed on an object added to the registry.
 
Fields inherited from interface org.mule.api.lifecycle.Initialisable
PHASE_NAME
 
Fields inherited from interface org.mule.api.lifecycle.Disposable
PHASE_NAME
 
Method Summary
 Object applyLifecycle(Object object)
          Will execute any lifecycle phases on an object without actually registering the object in the registry.
 Object applyLifecycle(Object object, String phase)
           
 Object applyProcessors(Object object)
          Will execute any processors on an object without actually registering the object in the registry.
 Object applyProcessors(Object object, int flags)
          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.
 Collection<Agent> getAgents()
          Deprecated. Use lookupAgent() instead
 Collection<Connector> getConnectors()
          Deprecated. Use lookupConnector() instead
 Collection<ImmutableEndpoint> getEndpoints()
          Deprecated. Use EndpointFactory for creation/lookup of individual endpoints instead
 Collection<Model> getModels()
          Deprecated. Use lookupModel() instead
 Collection<Transformer> getTransformers()
          Deprecated. Use lookupTransformer() instead
 Agent lookupAgent(String agentName)
           
 Connector lookupConnector(String name)
           
 EndpointBuilder lookupEndpointBuilder(String name)
          Looks-up endpoint builders which can be used to repeatably create endpoints with the same configuration.
 EndpointFactory lookupEndpointFactory()
          Deprecated. use MuleContext.getEndpointFactory() instead
 FlowConstruct lookupFlowConstruct(String name)
           
 Collection<FlowConstruct> lookupFlowConstructs()
           
 Model lookupModel(String name)
           
 Service lookupService(String name)
           
 ServiceDescriptor lookupServiceDescriptor(ServiceType type, String name, Properties overrides)
           
 Collection<Service> lookupServices()
           
 Collection<Service> lookupServices(String model)
           
 Model lookupSystemModel()
           
 Transformer lookupTransformer(Class<?> input, Class<?> output)
          Deprecated. use lookupTransformer(org.mule.api.transformer.DataType, org.mule.api.transformer.DataType) instead
 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. use lookupTransformers(org.mule.api.transformer.DataType, org.mule.api.transformer.DataType) instead
 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
 void registerAgent(Agent agent)
           
 void registerConnector(Connector connector)
           
 void registerEndpoint(ImmutableEndpoint endpoint)
           
 void registerEndpointBuilder(String name, EndpointBuilder builder)
           
 void registerFlowConstruct(FlowConstruct flowConstruct)
           
 void registerModel(Model model)
           
 void registerService(Service service)
           
 void registerTransformer(Transformer transformer)
           
 void unregisterAgent(String agentName)
           
 void unregisterConnector(String connectorName)
           
 void unregisterEndpoint(String endpointName)
           
 void unregisterFlowConstruct(String flowConstructName)
           
 void unregisterModel(String modelName)
           
 void unregisterService(String serviceName)
           
 void unregisterTransformer(String transformerName)
           
 
Methods inherited from interface org.mule.api.registry.Registry
fireLifecycle, get, getRegistryId, isReadOnly, isRemote, lookupByType, lookupObject, lookupObject, lookupObjects, lookupObjectsForLifecycle, registerObject, registerObject, registerObjects, unregisterObject, unregisterObject
 
Methods inherited from interface org.mule.api.lifecycle.Initialisable
initialise
 
Methods inherited from interface org.mule.api.lifecycle.Disposable
dispose
 

Field Detail

LIFECYCLE_BYPASS_FLAG

static final int LIFECYCLE_BYPASS_FLAG
Pass this flag as metadata of the Registry.registerObject(String, Object, Object) method to have lifecycle method calls on the registered objects omitted. Unless extending Mule, one will probably never have a use for this.

See Also:
Registry.registerObject(String, Object, Object), Constant Field Values

INJECT_PROCESSORS_BYPASS_FLAG

static final int INJECT_PROCESSORS_BYPASS_FLAG
Determines whether Inject processors should get executed on an object added to the registry Inject processors are responsible for processing inject interfaces such as MuleContextAware

See Also:
Constant Field Values

PRE_INIT_PROCESSORS_BYPASS_FLAG

static final int PRE_INIT_PROCESSORS_BYPASS_FLAG
Determines whether pre-init processors should get executed on an object added to the registry. Pre init processors are basically object processors that do not inject members into objects. These processors happen after the inject processors

See Also:
Constant Field Values
Method Detail

lookupConnector

Connector lookupConnector(String name)

lookupEndpointBuilder

EndpointBuilder lookupEndpointBuilder(String name)
Looks-up endpoint builders which can be used to repeatably create endpoints with the same configuration. These endpoint builder are either global endpoints or they are builders used to create named endpoints configured on routers and exception strategies.

Parameters:
name - the name of the endpointBuilder to find
Returns:
An endpointBuilder with the name specified or null if there is no endpoint builder with that name

lookupEndpointFactory

@Deprecated
EndpointFactory lookupEndpointFactory()
Deprecated. use MuleContext.getEndpointFactory() instead


lookupTransformer

Transformer lookupTransformer(String name)

lookupService

Service lookupService(String name)

lookupFlowConstruct

FlowConstruct lookupFlowConstruct(String name)

lookupTransformers

@Deprecated
List<Transformer> lookupTransformers(Class<?> input,
                                                Class<?> output)
Deprecated. use lookupTransformers(org.mule.api.transformer.DataType, org.mule.api.transformer.DataType) instead

This method will return a list of Transformer objects that accept the given input and return the given output type of object

Parameters:
input - The desiered input type for the transformer
output - the desired output type for the transformer
Returns:
a list of matching transformers. If there were no matchers an empty list is returned.

lookupTransformers

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

Parameters:
source - The desired input type for the transformer
result - the desired output type for the transformer
Returns:
a list of matching transformers. If there were no matchers an empty list is returned.
Since:
3.0.0

lookupTransformer

@Deprecated
Transformer lookupTransformer(Class<?> input,
                                         Class<?> output)
                              throws TransformerException
Deprecated. use lookupTransformer(org.mule.api.transformer.DataType, org.mule.api.transformer.DataType) instead

Will find a transformer that is the closest match to the desired input and output.

Parameters:
input - The desiered input type for the transformer
output - the desired output type for the transformer
Returns:
A transformer that exactly matches or the will accept the input and output parameters
Throws:
TransformerException - will be thrown if there is more than one match

lookupTransformer

Transformer lookupTransformer(DataType<?> source,
                              DataType<?> result)
                              throws TransformerException
Will find a transformer that is the closest match to the desired input and output.

Parameters:
source - The desiered input type for the transformer
result - the desired output type for the transformer
Returns:
A transformer that exactly matches or the will accept the input and output parameters
Throws:
TransformerException - will be thrown if there is more than one match
Since:
3.0.0

lookupServices

Collection<Service> lookupServices(String model)

lookupServices

Collection<Service> lookupServices()

lookupFlowConstructs

Collection<FlowConstruct> lookupFlowConstructs()

lookupModel

Model lookupModel(String name)

lookupSystemModel

Model lookupSystemModel()

lookupAgent

Agent lookupAgent(String agentName)

getModels

@Deprecated
Collection<Model> getModels()
Deprecated. Use lookupModel() instead


getConnectors

@Deprecated
Collection<Connector> getConnectors()
Deprecated. Use lookupConnector() instead


getEndpoints

@Deprecated
Collection<ImmutableEndpoint> getEndpoints()
Deprecated. Use EndpointFactory for creation/lookup of individual endpoints instead


getAgents

@Deprecated
Collection<Agent> getAgents()
Deprecated. Use lookupAgent() instead


getTransformers

@Deprecated
Collection<Transformer> getTransformers()
Deprecated. Use lookupTransformer() instead


registerConnector

void registerConnector(Connector connector)
                       throws MuleException
Throws:
MuleException

unregisterConnector

void unregisterConnector(String connectorName)
                         throws MuleException
Throws:
MuleException

registerEndpoint

void registerEndpoint(ImmutableEndpoint endpoint)
                      throws MuleException
Throws:
MuleException

unregisterEndpoint

void unregisterEndpoint(String endpointName)
                        throws MuleException
Throws:
MuleException

registerEndpointBuilder

void registerEndpointBuilder(String name,
                             EndpointBuilder builder)
                             throws MuleException
Throws:
MuleException

registerTransformer

void registerTransformer(Transformer transformer)
                         throws MuleException
Throws:
MuleException

unregisterTransformer

void unregisterTransformer(String transformerName)
                           throws MuleException
Throws:
MuleException

registerService

void registerService(Service service)
                     throws MuleException
Throws:
MuleException

unregisterService

void unregisterService(String serviceName)
                       throws MuleException
Throws:
MuleException

registerFlowConstruct

void registerFlowConstruct(FlowConstruct flowConstruct)
                           throws MuleException
Throws:
MuleException

unregisterFlowConstruct

void unregisterFlowConstruct(String flowConstructName)
                             throws MuleException
Throws:
MuleException

registerModel

void registerModel(Model model)
                   throws MuleException
Throws:
MuleException

unregisterModel

void unregisterModel(String modelName)
                     throws MuleException
Throws:
MuleException

registerAgent

void registerAgent(Agent agent)
                   throws MuleException
Throws:
MuleException

unregisterAgent

void unregisterAgent(String agentName)
                     throws MuleException
Throws:
MuleException

applyProcessorsAndLifecycle

Object applyProcessorsAndLifecycle(Object object)
                                   throws MuleException
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. This is useful for prototype objects that are created per request and would clutter the registry with single use objects. Not that this will only be applied to Mule registies. Thrid party registries such as Guice support wiring, but you need to get a reference to the container/context to call the method. This is so that wiring mechanisms dont trip over each other.

Parameters:
object - the object to process
Returns:
the same object with any processors and lifecycle methods called
Throws:
MuleException - if the registry fails to perform the lifecycle change or process object processors for the object.

applyProcessors

Object applyProcessors(Object object)
                       throws MuleException
Will execute any processors on an object without actually registering the object in the registry. This is useful for prototype objects that are created per request and would clutter the registry with single use objects. Not that this will only be applied to Mule registies. Thrid party registries such as Guice support wiring, but you need to get a reference to the container/context to call the method. This is so that wiring mechanisms dont trip over each other.

Parameters:
object - the object to process
Returns:
the same object with any processors called
Throws:
MuleException - if the registry fails to process object processors for the object.

applyProcessors

Object applyProcessors(Object object,
                       int flags)
                       throws MuleException
Will execute any processors on an object without actually registering the object in the registry. This is useful for prototype objects that are created per request and would clutter the registry with single use objects. Not that this will only be applied to Mule registies. Thrid party registries such as Guice support wiring, but you need to get a reference to the container/context to call the method. This is so that wiring mechanisms dont trip over each other.

Parameters:
object - the object to process
flags - MuleRegistry flags which control which injectors will be applied
Returns:
the same object with any processors called
Throws:
MuleException - if the registry fails to process object processors for the object.
Since:
3.0

applyLifecycle

Object applyLifecycle(Object object)
                      throws MuleException
Will execute any lifecycle phases on an object without actually registering the object in the registry. This is useful for prototype objects that are created per request and would clutter the registry with single use objects. The lifecycle applied is the lifecycle of the MuleContext. If multiple phases have been completed i.e. init and start, each phase will be executed on the object in order.

Parameters:
object - the object to apply the current lifecycle state to
Returns:
the same object with any lifecycle methods called
Throws:
MuleException - if the registry fails to execute a lifecycle method.

applyLifecycle

Object applyLifecycle(Object object,
                      String phase)
                      throws MuleException
Throws:
MuleException

lookupServiceDescriptor

ServiceDescriptor lookupServiceDescriptor(ServiceType type,
                                          String name,
                                          Properties overrides)
                                          throws ServiceException
Throws:
ServiceException


Copyright © 2003-2012 MuleSoft, Inc.. All Rights Reserved.