org.mule.client
Class DefaultLocalMuleClient

java.lang.Object
  extended by org.mule.client.DefaultLocalMuleClient
All Implemented Interfaces:
LocalMuleClient, MuleClient

public class DefaultLocalMuleClient
extends Object
implements LocalMuleClient


Nested Class Summary
static class DefaultLocalMuleClient.MuleClientFlowConstruct
          Placeholder class which makes the default exception handler available.
 
Field Summary
protected  MuleContext muleContext
           
 
Constructor Summary
DefaultLocalMuleClient(MuleContext muleContext)
           
 
Method Summary
protected  MuleEvent createMuleEvent(MuleMessage message, OutboundEndpoint endpoint)
           
 void dispatch(String url, MuleMessage message)
          Dispatches an event asynchronously to a endpointUri via a Mule server.
 void dispatch(String url, Object payload, Map<String,Object> messageProperties)
          Dispatches an event asynchronously to a endpointUri via a Mule server.
 MuleMessage process(OutboundEndpoint endpoint, MuleMessage message)
          Sends an event synchronously to a endpointUri via a Mule server and a resulting message is returned.
 MuleMessage process(OutboundEndpoint endpoint, Object payload, Map<String,Object> messageProperties)
          Sends an event synchronously to a endpointUri via a Mule server and a resulting message is returned.
 MuleMessage process(String uri, MessageExchangePattern mep, MuleMessage message)
          Processes a messsage with an outbound endpoint using the specified MessageExchangePattern
 MuleMessage process(String uri, MessageExchangePattern mep, Object payload, Map<String,Object> messageProperties)
          Processes a message with an outbound endpoint using the specified MessageExchangePattern
 MuleMessage request(InboundEndpoint endpoint, long timeout)
          Will receive an event from an endpointUri determined by the URL.
 MuleMessage request(String url, long timeout)
          Will receive an event from an endpointUri determined by the URL.
protected  MuleMessage returnMessage(MuleEvent event)
           
 MuleMessage send(String url, MuleMessage message)
          Sends an event synchronously to a endpointUri via a Mule server and a resulting message is returned.
 MuleMessage send(String url, MuleMessage message, long timeout)
          Sends an event synchronously to a endpointUri via a mule server and a resulting message is returned.
 MuleMessage send(String url, Object payload, Map<String,Object> messageProperties)
          Sends an event synchronously to a endpointUri via a Mule server and a resulting message is returned.
 MuleMessage send(String url, Object payload, Map<String,Object> messageProperties, long timeout)
          Sends an event synchronously to a endpointUri via a mule server and a resulting message is returned.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

muleContext

protected final MuleContext muleContext
Constructor Detail

DefaultLocalMuleClient

public DefaultLocalMuleClient(MuleContext muleContext)
Method Detail

process

public MuleMessage process(OutboundEndpoint endpoint,
                           Object payload,
                           Map<String,Object> messageProperties)
                    throws MuleException
Description copied from interface: LocalMuleClient
Sends an event synchronously to a endpointUri via a Mule server and a resulting message is returned.

Specified by:
process in interface LocalMuleClient
payload - the object that is the payload of the event
messageProperties - any properties to be associated with the payload. In the case of Jms you could set the JMSReplyTo property in these properties.
Returns:
A return message, this could be null if the the components invoked explicitly sets a return as null.
Throws:
MuleException

process

public MuleMessage process(OutboundEndpoint endpoint,
                           MuleMessage message)
                    throws MuleException
Description copied from interface: LocalMuleClient
Sends an event synchronously to a endpointUri via a Mule server and a resulting message is returned.

Specified by:
process in interface LocalMuleClient
message - the Message for the event
Returns:
A return message, this could be null if the the components invoked explicitly sets a return as null.
Throws:
MuleException

request

public MuleMessage request(InboundEndpoint endpoint,
                           long timeout)
                    throws MuleException
Description copied from interface: LocalMuleClient
Will receive an event from an endpointUri determined by the URL.

Specified by:
request in interface LocalMuleClient
Parameters:
endpoint - the Mule URL used to determine the destination and transport of the message
timeout - how long to block waiting to receive the event, if set to 0 the receive will not wait at all and if set to -1 the receive will wait forever
Returns:
the message received or null if no message was received
Throws:
MuleException

dispatch

public void dispatch(String url,
                     Object payload,
                     Map<String,Object> messageProperties)
              throws MuleException
Description copied from interface: MuleClient
Dispatches an event asynchronously to a endpointUri via a Mule server. The URL determines where to dispatch the event to.

Specified by:
dispatch in interface MuleClient
Parameters:
url - the Mule URL used to determine the destination and transport of the message
payload - the object that is the payload of the event
messageProperties - any properties to be associated with the payload. In the case of JMS you could set the JMSReplyTo property in these properties.
Throws:
MuleException

send

public MuleMessage send(String url,
                        Object payload,
                        Map<String,Object> messageProperties)
                 throws MuleException
Description copied from interface: MuleClient
Sends an event synchronously to a endpointUri via a Mule server and a resulting message is returned.

Specified by:
send in interface MuleClient
Parameters:
url - the Mule URL used to determine the destination and transport of the message
payload - the object that is the payload of the event
messageProperties - any properties to be associated with the payload. In the case of Jms you could set the JMSReplyTo property in these properties.
Returns:
A return message, this could be null if the the components invoked explicitly sets a return as null.
Throws:
MuleException

send

public MuleMessage send(String url,
                        MuleMessage message)
                 throws MuleException
Description copied from interface: MuleClient
Sends an event synchronously to a endpointUri via a Mule server and a resulting message is returned.

Specified by:
send in interface MuleClient
Parameters:
url - the Mule URL used to determine the destination and transport of the message
message - the Message for the event
Returns:
A return message, this could be null if the the components invoked explicitly sets a return as null.
Throws:
MuleException

send

public MuleMessage send(String url,
                        Object payload,
                        Map<String,Object> messageProperties,
                        long timeout)
                 throws MuleException
Description copied from interface: MuleClient
Sends an event synchronously to a endpointUri via a mule server and a resulting message is returned.

Specified by:
send in interface MuleClient
Parameters:
url - the Mule URL used to determine the destination and transport of the message
payload - the object that is the payload of the event
messageProperties - any properties to be associated with the payload. In the case of Jms you could set the JMSReplyTo property in these properties.
timeout - The time in milliseconds the the call should block waiting for a response
Returns:
A return message, this could be null if the the components invoked explicitly sets a return as null.
Throws:
MuleException

send

public MuleMessage send(String url,
                        MuleMessage message,
                        long timeout)
                 throws MuleException
Description copied from interface: MuleClient
Sends an event synchronously to a endpointUri via a mule server and a resulting message is returned.

Specified by:
send in interface MuleClient
Parameters:
url - the Mule URL used to determine the destination and transport of the message
message - The message to send
timeout - The time in milliseconds the the call should block waiting for a response
Returns:
A return message, this could be null if the the components invoked explicitly sets a return as null.
Throws:
MuleException

dispatch

public void dispatch(String url,
                     MuleMessage message)
              throws MuleException
Description copied from interface: MuleClient
Dispatches an event asynchronously to a endpointUri via a Mule server. The URL determines where to dispatch the event to.

Specified by:
dispatch in interface MuleClient
Parameters:
url - the Mule URL used to determine the destination and transport of the message
message - the message to send
Throws:
MuleException

request

public MuleMessage request(String url,
                           long timeout)
                    throws MuleException
Description copied from interface: MuleClient
Will receive an event from an endpointUri determined by the URL.

Specified by:
request in interface MuleClient
Parameters:
url - the Mule URL used to determine the destination and transport of the message
timeout - how long to block waiting to receive the event, if set to 0 the receive will not wait at all and if set to -1 the receive will wait forever
Returns:
the message received or null if no message was received
Throws:
MuleException

process

public MuleMessage process(String uri,
                           MessageExchangePattern mep,
                           Object payload,
                           Map<String,Object> messageProperties)
                    throws MuleException
Description copied from interface: MuleClient
Processes a message with an outbound endpoint using the specified MessageExchangePattern

Specified by:
process in interface MuleClient
mep - the MessageExchangePattern that should be used
payload - the message payload
messageProperties - and message properties that should be used (optional, use null otherwise)
Returns:
the result of endpoint invocation if the MessageExchangePattern defines a response else null.
Throws:
MuleException

process

public MuleMessage process(String uri,
                           MessageExchangePattern mep,
                           MuleMessage message)
                    throws MuleException
Description copied from interface: MuleClient
Processes a messsage with an outbound endpoint using the specified MessageExchangePattern

Specified by:
process in interface MuleClient
mep - the MessageExchangePattern that should be used
message - the message to be processed
Returns:
the result of endpoint invocation if the MessageExchangePattern defines a response else null.
Throws:
MuleException

createMuleEvent

protected MuleEvent createMuleEvent(MuleMessage message,
                                    OutboundEndpoint endpoint)
                             throws EndpointException
Throws:
EndpointException

returnMessage

protected MuleMessage returnMessage(MuleEvent event)


Copyright © 2003-2014 MuleSoft, Inc.. All Rights Reserved.