org.mule.config.builders
Class QuickConfigurationBuilder

java.lang.Object
  extended byorg.mule.config.builders.QuickConfigurationBuilder
All Implemented Interfaces:
ConfigurationBuilder

public class QuickConfigurationBuilder
extends Object
implements ConfigurationBuilder

QuickConfigurationBuilder is a configuration helper that can be used by clients, configuration scripts or test cases to quickly configure a manager.


Constructor Summary
QuickConfigurationBuilder()
          Constructs a default builder
QuickConfigurationBuilder(boolean disposeCurrent)
          Will construct a new Quick Config builder with the option of disposing of the current Manager if one exists
 
Method Summary
 UMOManager configure(ReaderResource[] configResources)
           
 UMOManager configure(ReaderResource[] configResources, Properties startupProperties)
          Will configure a UMOManager based on the configurations made available through Readers
 UMOManager configure(String configResources)
          Will configure a UMOManager based on the configuration file(s) provided.
 UMOManager configure(String configResources, String startupPropertiesFile)
          Will configure a UMOManager based on the configuration file(s) provided.
 UMODescriptor createDescriptor(String implementation, String name, String inboundEndpointUri, String outboundEndpointUri, Map properties)
          Creates a Mule Descriptor that can be further maniputalted by the calling class before registering it with the UMOModel
 UMODescriptor createDescriptor(String implementation, String name, UMOEndpoint inboundEndpoint, UMOEndpoint outboundEndpoint, Map properties)
          Creates a Mule Descriptor that can be further maniputalted by the calling class before registering it with the UMOModel
 UMODescriptor createDescriptor(String implementation, String name, UMOEndpointURI inboundEndpointUri, UMOEndpointURI outboundEndpointUri, Map properties)
          Creates a Mule Descriptor that can be further maniputalted by the calling class before registering it with the UMOModel
 UMOEndpoint createEndpoint(String uri, String name, boolean inbound)
           
 UMOEndpoint createEndpoint(String uri, String name, boolean inbound, String transformers)
           
 UMOEndpoint createEndpoint(String uri, String name, boolean inbound, String transformers, UMOFilter filter)
           
 UMOEndpoint createEndpoint(String uri, String name, boolean inbound, UMOFilter filter)
           
 UMOManager createStartedManager(boolean synchronous, String serverUrl)
          Configures a started manager.
 UMOManager createStartedManager(boolean synchronous, String serverUrl, String modeltype)
          Configures a started manager.
 UMOManager createStartedManager(boolean synchronous, String serverUrl, UMOConnector serverConnector)
          Configures a started manager.
 void disableAdminAgent()
           
 void disposeCurrent()
          Disposes the current MuleManager if there is one.
 UMOManager getManager()
           
protected  UMOModel getModel()
           
 boolean isConfigured()
           
 UMOComponent registerComponent(String implementation, String name, String inboundEndpoint, String outboundEndpoint, Map properties)
           
 UMOComponent registerComponent(String implementation, String name, UMOEndpoint inEndpoint, UMOEndpoint outEndpoint, Map properties)
           
 UMOComponent registerComponent(String implementation, String name, UMOEndpointURI inboundEndpointUri)
          Registers a java object as a Umo pcomponent that listens for events on the given url.
 UMOComponent registerComponent(String implementation, String name, UMOEndpointURI inboundEndpointUri, Map properties)
          Registers a java object as a Umo pcomponent that listens for events on the given url.
 UMOComponent registerComponent(String implementation, String name, UMOEndpointURI inboundEndpointUri, UMOEndpointURI outboundEndpointUri)
          Registers a java object as a Umo pcomponent that listens for and sends events on the given urls.
 UMOComponent registerComponent(String implementation, String name, UMOEndpointURI inboundEndpointUri, UMOEndpointURI outboundEndpointUri, Map properties)
          Registers a java object as a Umo pcomponent that listens for and sends events on the given urls.
 UMOComponent registerComponent(UMODescriptor descriptor)
          Registers a user configured MuleDescriptor of a components to the server.
 UMODescriptor registerComponentInstance(Object component, String name, UMOEndpointURI listenerEndpointUri)
          Registers a java object as a Umo pcomponent that listens for events on the given url.
 UMODescriptor registerComponentInstance(Object component, String name, UMOEndpointURI listenerEndpointUri, UMOEndpointURI sendEndpointUri)
          Registers a java object as a Umo pcomponent that listens for and sends events on the given urls.
 UMOEndpoint registerEndpoint(String uri, String name, boolean inbound)
           
 UMOEndpoint registerEndpoint(String uri, String name, boolean inbound, Map properties)
           
 UMOEndpoint registerEndpoint(String uri, String name, boolean inbound, Map properties, UMOFilter filter)
           
 void registerModel(String modelType, String name)
           
 void registerModel(UMOModel model)
           
 void setContainerContext(UMOContainerContext ctx)
          Sets the component resolver on the model.
 void unregisterComponent(String name)
          Unregisters a previously register components.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

QuickConfigurationBuilder

public QuickConfigurationBuilder()
Constructs a default builder


QuickConfigurationBuilder

public QuickConfigurationBuilder(boolean disposeCurrent)
Will construct a new Quick Config builder with the option of disposing of the current Manager if one exists

Parameters:
disposeCurrent - true to dispose the current manager
Method Detail

disposeCurrent

public void disposeCurrent()
Disposes the current MuleManager if there is one.


disableAdminAgent

public void disableAdminAgent()

registerModel

public void registerModel(String modelType,
                          String name)
                   throws UMOException
Throws:
UMOException

createStartedManager

public UMOManager createStartedManager(boolean synchronous,
                                       String serverUrl,
                                       String modeltype)
                                throws UMOException
Configures a started manager. This method will throw InitialisationException if the current manager is already started

Parameters:
synchronous - whether to start the manager in synchronous mode
serverUrl - the url used to receive client requests, or null if the server listening components should not be set up
Returns:
the configured manager
Throws:
UMOException - if the manager is already started or it fails to start

createStartedManager

public UMOManager createStartedManager(boolean synchronous,
                                       String serverUrl)
                                throws UMOException
Configures a started manager. This method will throw InitialisationException if the current manager is already started

Parameters:
synchronous - whether to start the manager in synchronous mode
serverUrl - the url used to receive client requests, or null if the server listening components should not be set up
Returns:
the configured manager
Throws:
UMOException - if the manager is already started or it fails to start

createStartedManager

public UMOManager createStartedManager(boolean synchronous,
                                       String serverUrl,
                                       UMOConnector serverConnector)
                                throws UMOException
Configures a started manager. This method will throw InitialisationException if the current manager is already started

Parameters:
synchronous - whether to start the manager in synchronous mode
serverUrl - the url used to receive client requests, or null if the server listening components should not be set up
serverConnector - The server connector to use for the serverUrl
Returns:
the configured manager
Throws:
UMOException - if the manager is already started or it fails to start

registerComponentInstance

public UMODescriptor registerComponentInstance(Object component,
                                               String name,
                                               UMOEndpointURI listenerEndpointUri)
                                        throws UMOException
Registers a java object as a Umo pcomponent that listens for events on the given url. By default the ThreadingProfile for the components will be set so that there will only be one thread of execution.

Parameters:
component - any java object, Mule will it's endpointUri discovery to determine which event to invoke based on the evnet payload type
name - The identifying name of the components. This can be used to later unregister it
listenerEndpointUri - The url endpointUri to listen to
Throws:
UMOException

registerComponentInstance

public UMODescriptor registerComponentInstance(Object component,
                                               String name,
                                               UMOEndpointURI listenerEndpointUri,
                                               UMOEndpointURI sendEndpointUri)
                                        throws UMOException
Registers a java object as a Umo pcomponent that listens for and sends events on the given urls. By default the ThreadingProfile for the components will be set so that there will only be one thread of execution.

Parameters:
component - any java object, Mule will it's endpointUri discovery to determine which event to invoke based on the evnet payload type
name - The identifying name of the components. This can be used to later unregister it
listenerEndpointUri - The url endpointUri to listen to
sendEndpointUri - The url endpointUri to dispatch to
Throws:
UMOException

registerComponent

public UMOComponent registerComponent(String implementation,
                                      String name,
                                      String inboundEndpoint,
                                      String outboundEndpoint,
                                      Map properties)
                               throws UMOException
Throws:
UMOException

registerComponent

public UMOComponent registerComponent(String implementation,
                                      String name,
                                      UMOEndpoint inEndpoint,
                                      UMOEndpoint outEndpoint,
                                      Map properties)
                               throws UMOException
Throws:
UMOException

registerComponent

public UMOComponent registerComponent(UMODescriptor descriptor)
                               throws UMOException
Registers a user configured MuleDescriptor of a components to the server. If users want to register object instances with the server rather than class names that get created at runtime or reference to objects in the container, the user must call the descriptors setImplementationInstance() method - MyBean implementation = new MyBean(); descriptor.setImplementationInstance(implementation); Calling this method is equivilent to calling UMOModel.registerComponent(..)

Parameters:
descriptor - the componet descriptor to register
Throws:
UMOException - the descriptor is invalid or cannot be initialised or started
See Also:
UMOModel

registerComponent

public UMOComponent registerComponent(String implementation,
                                      String name,
                                      UMOEndpointURI inboundEndpointUri)
                               throws UMOException
Registers a java object as a Umo pcomponent that listens for events on the given url. By default the ThreadingProfile for the components will be set so that there will only be one thread of execution.

Parameters:
implementation - either a container refernece to an object or a fully qualified class name to use as the component implementation
name - The identifying name of the components. This can be used to later unregister it
inboundEndpointUri - The url endpointUri to listen to
Throws:
UMOException

registerComponent

public UMOComponent registerComponent(String implementation,
                                      String name,
                                      UMOEndpointURI inboundEndpointUri,
                                      Map properties)
                               throws UMOException
Registers a java object as a Umo pcomponent that listens for events on the given url. By default the ThreadingProfile for the components will be set so that there will only be one thread of execution.

Parameters:
implementation - either a container refernece to an object or a fully qualified class name to use as the component implementation
name - The identifying name of the components. This can be used to later unregister it
inboundEndpointUri - The url endpointUri to listen to
properties - properties to set on the component
Throws:
UMOException

registerComponent

public UMOComponent registerComponent(String implementation,
                                      String name,
                                      UMOEndpointURI inboundEndpointUri,
                                      UMOEndpointURI outboundEndpointUri)
                               throws UMOException
Registers a java object as a Umo pcomponent that listens for and sends events on the given urls. By default the ThreadingProfile for the components will be set so that there will only be one thread of execution.

Parameters:
implementation - either a container refernece to an object or a fully qualified class name to use as the component implementation which event to invoke based on the evnet payload type
name - The identifying name of the components. This can be used to later unregister it
inboundEndpointUri - The url endpointUri to listen to
outboundEndpointUri - The url endpointUri to dispatch to
Throws:
UMOException

registerComponent

public UMOComponent registerComponent(String implementation,
                                      String name,
                                      UMOEndpointURI inboundEndpointUri,
                                      UMOEndpointURI outboundEndpointUri,
                                      Map properties)
                               throws UMOException
Registers a java object as a Umo pcomponent that listens for and sends events on the given urls. By default the ThreadingProfile for the components will be set so that there will only be one thread of execution.

Parameters:
implementation - either a container refernece to an object or a fully qualified class name to use as the component implementation which event to invoke based on the evnet payload type
name - The identifying name of the components. This can be used to later unregister it
inboundEndpointUri - The url endpointUri to listen to
outboundEndpointUri - The url endpointUri to dispatch to
properties - properties to set on the component
Throws:
UMOException

createDescriptor

public UMODescriptor createDescriptor(String implementation,
                                      String name,
                                      String inboundEndpointUri,
                                      String outboundEndpointUri,
                                      Map properties)
                               throws UMOException
Creates a Mule Descriptor that can be further maniputalted by the calling class before registering it with the UMOModel

Parameters:
implementation - either a container refernece to an object or a fully qualified class name to use as the component implementation which event to invoke based on the evnet payload type
name - The identifying name of the component. This can be used to later unregister it
inboundEndpointUri - The url endpointUri to listen to. Can be null
outboundEndpointUri - The url endpointUri to dispatch to. Can be null
properties - properties to set on the component. Can be null
Throws:
UMOException

createDescriptor

public UMODescriptor createDescriptor(String implementation,
                                      String name,
                                      UMOEndpointURI inboundEndpointUri,
                                      UMOEndpointURI outboundEndpointUri,
                                      Map properties)
                               throws UMOException
Creates a Mule Descriptor that can be further maniputalted by the calling class before registering it with the UMOModel

Parameters:
implementation - either a container refernece to an object or a fully qualified class name to use as the component implementation which event to invoke based on the evnet payload type
name - The identifying name of the component. This can be used to later unregister it
inboundEndpointUri - The url endpointUri to listen to. Can be null
outboundEndpointUri - The url endpointUri to dispatch to. Can be null
properties - properties to set on the component. Can be null
Throws:
UMOException

createDescriptor

public UMODescriptor createDescriptor(String implementation,
                                      String name,
                                      UMOEndpoint inboundEndpoint,
                                      UMOEndpoint outboundEndpoint,
                                      Map properties)
                               throws UMOException
Creates a Mule Descriptor that can be further maniputalted by the calling class before registering it with the UMOModel

Parameters:
implementation - either a container refernece to an object or a fully qualified class name to use as the component implementation which event to invoke based on the evnet payload type
name - The identifying name of the component. This can be used to later unregister it
inboundEndpoint - The endpoint to listen to. Can be null
outboundEndpoint - The endpoint to dispatch to. Can be null
properties - properties to set on the component. Can be null
Throws:
UMOException

setContainerContext

public void setContainerContext(UMOContainerContext ctx)
                         throws UMOException
Sets the component resolver on the model. Component resolver is used to look up components in an external container such as Spring or Pico

Parameters:
ctx -
Throws:
UMOException

unregisterComponent

public void unregisterComponent(String name)
                         throws UMOException
Unregisters a previously register components. This will also unregister any listeners for the components Calling this method is equivilent to calling UMOModel.unregisterComponent(..)

Parameters:
name - the name of the componet to unregister
Throws:
UMOException - if unregistering the components fails, i.e. The underlying transport fails to unregister a listener. If the components does not exist, this method should not throw an exception.
See Also:
UMOModel

createEndpoint

public UMOEndpoint createEndpoint(String uri,
                                  String name,
                                  boolean inbound)
                           throws UMOException
Throws:
UMOException

createEndpoint

public UMOEndpoint createEndpoint(String uri,
                                  String name,
                                  boolean inbound,
                                  String transformers)
                           throws UMOException
Throws:
UMOException

createEndpoint

public UMOEndpoint createEndpoint(String uri,
                                  String name,
                                  boolean inbound,
                                  UMOFilter filter)
                           throws UMOException
Throws:
UMOException

createEndpoint

public UMOEndpoint createEndpoint(String uri,
                                  String name,
                                  boolean inbound,
                                  String transformers,
                                  UMOFilter filter)
                           throws UMOException
Throws:
UMOException

registerEndpoint

public UMOEndpoint registerEndpoint(String uri,
                                    String name,
                                    boolean inbound)
                             throws UMOException
Throws:
UMOException

registerEndpoint

public UMOEndpoint registerEndpoint(String uri,
                                    String name,
                                    boolean inbound,
                                    Map properties)
                             throws UMOException
Throws:
UMOException

registerEndpoint

public UMOEndpoint registerEndpoint(String uri,
                                    String name,
                                    boolean inbound,
                                    Map properties,
                                    UMOFilter filter)
                             throws UMOException
Throws:
UMOException

registerModel

public void registerModel(UMOModel model)
                   throws UMOException
Throws:
UMOException

getManager

public UMOManager getManager()

configure

public UMOManager configure(String configResources)
                     throws ConfigurationException
Description copied from interface: ConfigurationBuilder
Will configure a UMOManager based on the configuration file(s) provided.

Specified by:
configure in interface ConfigurationBuilder
Parameters:
configResources - a comma separated list of configuration files to load, this should be accessible on the classpath or filesystem
Returns:
A configured UMOManager
Throws:
ConfigurationException

configure

public UMOManager configure(String configResources,
                            String startupPropertiesFile)
                     throws ConfigurationException
Description copied from interface: ConfigurationBuilder
Will configure a UMOManager based on the configuration file(s) provided.

Specified by:
configure in interface ConfigurationBuilder
Parameters:
configResources - - A comma-separated list of configuration files to load, these should be accessible on the classpath or filesystem
startupPropertiesFile - - An optional file containing startup properties. This is useful for managing different environments (dev, test, production)
Returns:
A configured UMOManager
Throws:
ConfigurationException

configure

public UMOManager configure(ReaderResource[] configResources)
                     throws ConfigurationException
Throws:
ConfigurationException

configure

public UMOManager configure(ReaderResource[] configResources,
                            Properties startupProperties)
                     throws ConfigurationException
Description copied from interface: ConfigurationBuilder
Will configure a UMOManager based on the configurations made available through Readers

Specified by:
configure in interface ConfigurationBuilder
Parameters:
configResources - - An array of Readers, each Reader contains a portion of the Mule server configuration.
startupProperties - - Optional properties to be set before configuring the Mule server. This is useful for managing different environments (dev, test, production)
Returns:
A configured UMOManager
Throws:
ConfigurationException

isConfigured

public boolean isConfigured()
Specified by:
isConfigured in interface ConfigurationBuilder

getModel

protected UMOModel getModel()
                     throws UMOException
Throws:
UMOException


Copyright © 2003-2008 MuleSource, Inc.. All Rights Reserved.