org.mule.config.builders
Class QuickConfigurationBuilder

java.lang.Object
  extended byorg.mule.config.builders.QuickConfigurationBuilder

public class QuickConfigurationBuilder
extends java.lang.Object

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

Version:
$Revision: 1.2 $
Author:
Ross Mason

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
 UMODescriptor createDescriptor(java.lang.String implementation, java.lang.String name, java.lang.String inboundEndpointUri, java.lang.String outboundEndpointUri, java.util.Map properties)
          Creates a Mule Descriptor that can be further maniputalted by the calling class before registering it with the UMOModel
 UMODescriptor createDescriptor(java.lang.String implementation, java.lang.String name, UMOEndpointURI inboundEndpointUri, UMOEndpointURI outboundEndpointUri, java.util.Map properties)
          Creates a Mule Descriptor that can be further maniputalted by the calling class before registering it with the UMOModel
 UMOManager createStartedManager(boolean synchronous, java.lang.String serverUrl)
          Configures a started manager.
 UMOManager createStartedManager(boolean synchronous, java.lang.String serverUrl, UMOConnector serverConnector)
          Configures a started manager.
 void disposeCurrent()
          Disposes the current MuleManager if there is one.
 UMOComponent registerComponent(java.lang.String implementation, java.lang.String name, UMOEndpointURI inboundEndpointUri)
          Registers a java object as a Umo pcomponent that listens for events on the given url.
 UMOComponent registerComponent(java.lang.String implementation, java.lang.String name, UMOEndpointURI inboundEndpointUri, java.util.Map properties)
          Registers a java object as a Umo pcomponent that listens for events on the given url.
 UMOComponent registerComponent(java.lang.String implementation, java.lang.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(java.lang.String implementation, java.lang.String name, UMOEndpointURI inboundEndpointUri, UMOEndpointURI outboundEndpointUri, java.util.Map properties)
          Registers a java object as a Umo pcomponent that listens for and sends events on the given urls.
 void registerComponent(UMODescriptor descriptor)
          Registers a user configured MuleDescriptor of a components to the server.
 UMODescriptor registerComponentInstance(java.lang.Object component, java.lang.String name, UMOEndpointURI listenerEndpointUri)
          Registers a java object as a Umo pcomponent that listens for events on the given url.
 UMODescriptor registerComponentInstance(java.lang.Object component, java.lang.String name, UMOEndpointURI listenerEndpointUri, UMOEndpointURI sendEndpointUri)
          Registers a java object as a Umo pcomponent that listens for and sends events on the given urls.
 void setContainerContext(UMOContainerContext ctx)
          Sets the component resolver on the model.
 void unregisterComponent(java.lang.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)
                          throws UMOException
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
Throws:
UMOException - if the manager throws an exception when disposing
Method Detail

disposeCurrent

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

Throws:
UMOException - if there is a current Manager and it fails to shutdown

createStartedManager

public UMOManager createStartedManager(boolean synchronous,
                                       java.lang.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,
                                       java.lang.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(java.lang.Object component,
                                               java.lang.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(java.lang.Object component,
                                               java.lang.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 void 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(java.lang.String implementation,
                                      java.lang.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(java.lang.String implementation,
                                      java.lang.String name,
                                      UMOEndpointURI inboundEndpointUri,
                                      java.util.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(java.lang.String implementation,
                                      java.lang.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(java.lang.String implementation,
                                      java.lang.String name,
                                      UMOEndpointURI inboundEndpointUri,
                                      UMOEndpointURI outboundEndpointUri,
                                      java.util.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(java.lang.String implementation,
                                      java.lang.String name,
                                      java.lang.String inboundEndpointUri,
                                      java.lang.String outboundEndpointUri,
                                      java.util.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(java.lang.String implementation,
                                      java.lang.String name,
                                      UMOEndpointURI inboundEndpointUri,
                                      UMOEndpointURI outboundEndpointUri,
                                      java.util.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

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(java.lang.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


Copyright © 2003-2005 SymphonySoft Limited. All Rights Reserved.