org.mule.extras.client
Class RemoteDispatcher

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

public class RemoteDispatcher
extends Object
implements org.mule.umo.lifecycle.Disposable

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


Field Summary
protected static Log logger
          logger used by this class
 
Constructor Summary
protected RemoteDispatcher(String endpoint)
           
protected RemoteDispatcher(String endpoint, org.mule.umo.security.UMOCredentials credentials)
           
 
Method Summary
 org.mule.umo.FutureMessageResult asyncReceiveRemote(String endpoint, int timeout)
           
protected  org.mule.umo.UMOMessage dispatchAction(org.mule.impl.internal.notifications.AdminNotification action, boolean synchronous, int timeout)
           
 void dispatchRemote(String endpoint, Object payload, Map messageProperties)
           
 void dispatchToRemoteComponent(String component, Object payload, Map messageProperties)
          Dispatcher an event asynchronously to a components on a remote Mule instance.
 void dispose()
           
protected  org.mule.umo.UMOMessage doToRemote(String endpoint, Object payload, Map messageProperties, boolean synchronous, int timeout)
           
protected  org.mule.umo.UMOMessage doToRemoteComponent(String component, Object payload, Map messageProperties, boolean synchronous)
           
 org.mule.transformers.wire.WireFormat getWireFormat()
           
 org.mule.umo.UMOMessage receiveRemote(String endpoint, int timeout)
           
 org.mule.umo.FutureMessageResult sendAsyncRemote(String endpoint, Object payload, Map messageProperties)
           
 org.mule.umo.FutureMessageResult sendAsyncToRemoteComponent(String component, String transformers, Object payload, 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.
 org.mule.umo.UMOMessage sendRemote(String endpoint, Object payload, Map messageProperties)
           
 org.mule.umo.UMOMessage sendRemote(String endpoint, Object payload, Map messageProperties, int timeout)
           
 org.mule.umo.UMOMessage sendToRemoteComponent(String component, Object payload, Map messageProperties)
          sends an event synchronously to a components on a remote Mule instance.
protected  void setCredentials(org.mule.umo.UMOMessage message)
           
protected  void setExecutor(Executor e)
           
 void setWireFormat(org.mule.transformers.wire.WireFormat wireFormat)
           
protected  void updateContext(org.mule.umo.UMOMessage message, org.mule.umo.endpoint.UMOEndpoint endpoint, boolean synchronous)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

logger

protected static final Log logger
logger used by this class

Constructor Detail

RemoteDispatcher

protected RemoteDispatcher(String endpoint,
                           org.mule.umo.security.UMOCredentials credentials)
                    throws org.mule.umo.UMOException

RemoteDispatcher

protected RemoteDispatcher(String endpoint)
                    throws org.mule.umo.UMOException
Method Detail

setExecutor

protected void setExecutor(Executor e)

dispatchToRemoteComponent

public void dispatchToRemoteComponent(String component,
                                      Object payload,
                                      Map messageProperties)
                               throws org.mule.umo.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:
org.mule.umo.UMOException - if the dispatch fails or the components or transfromers cannot be found

sendToRemoteComponent

public org.mule.umo.UMOMessage sendToRemoteComponent(String component,
                                                     Object payload,
                                                     Map messageProperties)
                                              throws org.mule.umo.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:
org.mule.umo.UMOException - if the dispatch fails or the components or transfromers cannot be found

sendAsyncToRemoteComponent

public org.mule.umo.FutureMessageResult sendAsyncToRemoteComponent(String component,
                                                                   String transformers,
                                                                   Object payload,
                                                                   Map messageProperties)
                                                            throws org.mule.umo.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:
org.mule.umo.UMOException - if the dispatch fails or the components or transfromers cannot be found

sendRemote

public org.mule.umo.UMOMessage sendRemote(String endpoint,
                                          Object payload,
                                          Map messageProperties,
                                          int timeout)
                                   throws org.mule.umo.UMOException
Throws:
org.mule.umo.UMOException

sendRemote

public org.mule.umo.UMOMessage sendRemote(String endpoint,
                                          Object payload,
                                          Map messageProperties)
                                   throws org.mule.umo.UMOException
Throws:
org.mule.umo.UMOException

dispatchRemote

public void dispatchRemote(String endpoint,
                           Object payload,
                           Map messageProperties)
                    throws org.mule.umo.UMOException
Throws:
org.mule.umo.UMOException

sendAsyncRemote

public org.mule.umo.FutureMessageResult sendAsyncRemote(String endpoint,
                                                        Object payload,
                                                        Map messageProperties)
                                                 throws org.mule.umo.UMOException
Throws:
org.mule.umo.UMOException

receiveRemote

public org.mule.umo.UMOMessage receiveRemote(String endpoint,
                                             int timeout)
                                      throws org.mule.umo.UMOException
Throws:
org.mule.umo.UMOException

asyncReceiveRemote

public org.mule.umo.FutureMessageResult asyncReceiveRemote(String endpoint,
                                                           int timeout)
                                                    throws org.mule.umo.UMOException
Throws:
org.mule.umo.UMOException

doToRemoteComponent

protected org.mule.umo.UMOMessage doToRemoteComponent(String component,
                                                      Object payload,
                                                      Map messageProperties,
                                                      boolean synchronous)
                                               throws org.mule.umo.UMOException
Throws:
org.mule.umo.UMOException

doToRemote

protected org.mule.umo.UMOMessage doToRemote(String endpoint,
                                             Object payload,
                                             Map messageProperties,
                                             boolean synchronous,
                                             int timeout)
                                      throws org.mule.umo.UMOException
Throws:
org.mule.umo.UMOException

dispatchAction

protected org.mule.umo.UMOMessage dispatchAction(org.mule.impl.internal.notifications.AdminNotification action,
                                                 boolean synchronous,
                                                 int timeout)
                                          throws org.mule.umo.UMOException
Throws:
org.mule.umo.UMOException

dispose

public void dispose()
Specified by:
dispose in interface org.mule.umo.lifecycle.Disposable

setCredentials

protected void setCredentials(org.mule.umo.UMOMessage message)

getWireFormat

public org.mule.transformers.wire.WireFormat getWireFormat()

setWireFormat

public void setWireFormat(org.mule.transformers.wire.WireFormat wireFormat)

updateContext

protected void updateContext(org.mule.umo.UMOMessage message,
                             org.mule.umo.endpoint.UMOEndpoint endpoint,
                             boolean synchronous)
                      throws org.mule.umo.UMOException
Throws:
org.mule.umo.UMOException


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