You are viewing an older version of this section. Click here to navigate to the latest version.

Bootstrapping the Registry

Mule ESB provides a mechanism for adding objects to the Mule registry as soon as a module or transport is loaded. This is useful for registering shared transformers or expression evaluators.

All objects you add to the registry using this mechanism must have a default constructor. They can implement injection interfaces such as org.mule.MuleContextAware and lifecycle interfaces such as org.mule.api.lifecycle.Initialisable.

Specifying the Objects to Bootstrap

To load an object into the Mule registry using the bootstrap mechanism, you specify the object in the properties file, which you then store in the META-INF directory for the transport or module. For example:


Each entry in the file is a simple key/value pair that defines the object:


If this file is in a module or transport’s META-INF directory, Mule will register an instance of with a key of 'myobject' into the local registry when that module or transport is loaded.

If you want to ensure that the object gets a unique ID in the local registry, you can use object.n for the key, where n is a sequential number:


Adding Transformers

When adding transformers, you can also define the returnClass and name of the transformer as parameters:

transformer.2=org.mule.transport.jms.transformers.JMSMessageToObject,returnClass=java.lang.String, name=JMSMessageToString

Note that the key used for transformers must be transformer.n where n is a sequential number.

If the transformer name is not specified, Mule will automatically generate the name as JMSMessageToXXX where XXX is the return class name, such as JMSMessageToString. If no returnClass is specified, the default value in the transformer will be used.