org.mule.extras.client
Class RemoteDispatcher

java.lang.Object
  extended byorg.mule.extras.client.RemoteDispatcher
All Implemented Interfaces:
Disposable

public class RemoteDispatcher
extends java.lang.Object
implements Disposable

RemoteDispatcher is used to make and recieve requests to a remote Mule instance. It is used to proxy requests to Mule using the Server Url as the the transport channel.

Version:
$Revision: 1.6 $
Author:
Ross Mason

Field Summary
protected static Log logger
          logger used by this class
 
Method Summary
 FutureMessageResult asyncReceiveRemote(java.lang.String endpoint, int timeout)
           
protected  UMOMessage dispatchAction(AdminEvent action, boolean synchronous, int timeout)
           
 void dispatchRemote(java.lang.String endpoint, java.lang.Object payload, java.util.Map messageProperties)
           
 void dispatchToRemoteComponent(java.lang.String component, java.lang.Object payload, java.util.Map messageProperties)
          Dispatcher an event asynchronously to a components on a remote Mule instance.
 void dispose()
          A lifecycle method where implementor should fee up any resources If an exception is thrown it should just be logged and processing should continue.
protected  UMOMessage doToRemote(java.lang.String endpoint, java.lang.Object payload, java.util.Map messageProperties, boolean synchronous)
           
protected  UMOMessage doToRemoteComponent(java.lang.String component, java.lang.Object payload, java.util.Map messageProperties, boolean synchronous)
           
 UMOMessage receiveRemote(java.lang.String endpoint, int timeout)
           
 FutureMessageResult sendAsyncRemote(java.lang.String endpoint, java.lang.Object payload, java.util.Map messageProperties)
           
 FutureMessageResult sendAsyncToRemoteComponent(java.lang.String component, java.lang.String transformers, java.lang.Object payload, java.util.Map messageProperties)
          sends an event to a components on a remote Mule instance, while making the result of the event trigger available as a Future result that can be accessed later by client code.
 UMOMessage sendRemote(java.lang.String endpoint, java.lang.Object payload, java.util.Map messageProperties)
           
 UMOMessage sendToRemoteComponent(java.lang.String component, java.lang.Object payload, java.util.Map messageProperties)
          sends an event synchronously to a components on a remote Mule instance.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

logger

protected static transient Log logger
logger used by this class

Method Detail

dispatchToRemoteComponent

public void dispatchToRemoteComponent(java.lang.String component,
                                      java.lang.Object payload,
                                      java.util.Map messageProperties)
                               throws UMOException
Dispatcher an event asynchronously to a components on a remote Mule instance. Users can endpoint a url to a remote Mule server in the constructor of a Mule client, by default the default Mule server url tcp://localhost:60504 is used.

Parameters:
component - the name of the Mule components to dispatch to
payload - the object that is the payload of the event
messageProperties - any properties to be associated with the payload. as null
Throws:
UMOException - if the dispatch fails or the components or transfromers cannot be found

sendToRemoteComponent

public UMOMessage sendToRemoteComponent(java.lang.String component,
                                        java.lang.Object payload,
                                        java.util.Map messageProperties)
                                 throws UMOException
sends an event synchronously to a components on a remote Mule instance. Users can endpoint a url to a remote Mule server in the constructor of a Mule client, by default the default Mule server url tcp://localhost:60504 is used.

Parameters:
component - the name of the Mule components to send to
payload - the object that is the payload of the event
messageProperties - any properties to be associated with the payload. as null
Returns:
the result message if any of the invocation
Throws:
UMOException - if the dispatch fails or the components or transfromers cannot be found

sendAsyncToRemoteComponent

public FutureMessageResult sendAsyncToRemoteComponent(java.lang.String component,
                                                      java.lang.String transformers,
                                                      java.lang.Object payload,
                                                      java.util.Map messageProperties)
                                               throws UMOException
sends an event to a components on a remote Mule instance, while making the result of the event trigger available as a Future result that can be accessed later by client code. Users can endpoint a url to a remote Mule server in the constructor of a Mule client, by default the default Mule server url tcp://localhost:60504 is used.

Parameters:
component - the name of the Mule components to send to
transformers - a comma separated list of transformers to apply to the result message
payload - the object that is the payload of the event
messageProperties - any properties to be associated with the payload. as null
Returns:
the result message if any of the invocation
Throws:
UMOException - if the dispatch fails or the components or transfromers cannot be found

sendRemote

public UMOMessage sendRemote(java.lang.String endpoint,
                             java.lang.Object payload,
                             java.util.Map messageProperties)
                      throws UMOException
Throws:
UMOException

dispatchRemote

public void dispatchRemote(java.lang.String endpoint,
                           java.lang.Object payload,
                           java.util.Map messageProperties)
                    throws UMOException
Throws:
UMOException

sendAsyncRemote

public FutureMessageResult sendAsyncRemote(java.lang.String endpoint,
                                           java.lang.Object payload,
                                           java.util.Map messageProperties)
                                    throws UMOException
Throws:
UMOException

receiveRemote

public UMOMessage receiveRemote(java.lang.String endpoint,
                                int timeout)
                         throws UMOException
Throws:
UMOException

asyncReceiveRemote

public FutureMessageResult asyncReceiveRemote(java.lang.String endpoint,
                                              int timeout)
                                       throws UMOException
Throws:
UMOException

doToRemoteComponent

protected UMOMessage doToRemoteComponent(java.lang.String component,
                                         java.lang.Object payload,
                                         java.util.Map messageProperties,
                                         boolean synchronous)
                                  throws UMOException
Throws:
UMOException

doToRemote

protected UMOMessage doToRemote(java.lang.String endpoint,
                                java.lang.Object payload,
                                java.util.Map messageProperties,
                                boolean synchronous)
                         throws UMOException
Throws:
UMOException

dispatchAction

protected UMOMessage dispatchAction(AdminEvent action,
                                    boolean synchronous,
                                    int timeout)
                             throws UMOException
Throws:
UMOException

dispose

public void dispose()
Description copied from interface: Disposable
A lifecycle method where implementor should fee up any resources If an exception is thrown it should just be logged and processing should continue. This method should not throw Runtime exceptions

Specified by:
dispose in interface Disposable


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