org.mule.transport.jms
Class JmsMessageDispatcher

java.lang.Object
  extended by org.mule.transport.AbstractTransportMessageHandler
      extended by org.mule.transport.AbstractMessageDispatcher
          extended by org.mule.transport.jms.JmsMessageDispatcher
All Implemented Interfaces:
Disposable, Initialisable, Lifecycle, LifecycleStateEnabled, Startable, Stoppable, MessageProcessor, Connectable, MessageDispatcher

public class JmsMessageDispatcher
extends AbstractMessageDispatcher

JmsMessageDispatcher is responsible for dispatching messages to JMS destinations. All JMS semantics apply and settings such as replyTo and QoS properties are read from the event properties or defaults are used (according to the JMS specification)


Nested Class Summary
protected  class JmsMessageDispatcher.ReplyToListener
           
 
Field Summary
 
Fields inherited from class org.mule.transport.AbstractMessageDispatcher
defaultOutboundTransformers, defaultResponseTransformers
 
Fields inherited from class org.mule.transport.AbstractTransportMessageHandler
connected, endpoint, lifecycleManager, logger, muleMessageFactory, retryTemplate
 
Fields inherited from interface org.mule.api.transport.MessageDispatcher
RECEIVE_NO_WAIT, RECEIVE_WAIT_INDEFINITELY
 
Fields inherited from interface org.mule.api.lifecycle.Initialisable
PHASE_NAME
 
Fields inherited from interface org.mule.api.lifecycle.Startable
PHASE_NAME
 
Fields inherited from interface org.mule.api.lifecycle.Stoppable
PHASE_NAME
 
Fields inherited from interface org.mule.api.lifecycle.Disposable
PHASE_NAME
 
Constructor Summary
JmsMessageDispatcher(OutboundEndpoint endpoint)
           
 
Method Summary
protected  void applyOutboundTransformers(MuleEvent event)
           
protected  MuleMessage createMessageWithJmsMessagePayload(Message jmsMessage)
           
protected  MessageConsumer createReplyToConsumer(Message currentMessage, MuleEvent event, Session session, Destination replyTo, boolean topic)
           
protected  void doConnect()
           
protected  void doDisconnect()
           
protected  void doDispatch(MuleEvent event)
           
protected  void doDispose()
           
protected  MuleMessage doSend(MuleEvent event)
           
protected  Destination getReplyToDestination(Message message, Session session, MuleEvent event, boolean remoteSync, boolean topic)
           
protected  void handleMultiTx(Session session)
          Deprecated. 
protected  boolean isDisableTemporaryDestinations()
           
protected  boolean isHandleReplyTo(Message msg, MuleEvent event)
          Some JMS implementations do not support ReplyTo or require some further fiddling of the message
protected  void preTransformMessage(MuleMessage message)
          This method is called before the current message is transformed.
protected  void processMessage(Message msg, MuleEvent event)
          This method is called once the JMS message is created.
 
Methods inherited from class org.mule.transport.AbstractMessageDispatcher
applyResponseTransformers, createLifecycleManager, getDispatcherName, getEndpoint, getWorkManager, process, returnResponse, returnResponse
 
Methods inherited from class org.mule.transport.AbstractTransportMessageHandler
activate, connect, connectHandler, createMuleMessage, createMuleMessage, createMuleMessage, createMuleMessageFactory, createNullMuleMessage, disconnect, dispose, disposeAndLogException, doInitialise, doStart, doStartHandler, doStop, getConnectEventId, getConnectionDescription, getConnector, getLifecycleState, initialise, initializeMessageFactory, initializeRetryPolicy, isConnected, isDoThreading, isStarted, isStarting, isStopped, isStopping, passivate, setEndpoint, start, stop, toString, validate, validateConnection
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.mule.api.transport.MessageDispatcher
activate, createMuleMessage, createMuleMessage, getConnector, passivate, validate
 
Methods inherited from interface org.mule.api.transport.Connectable
connect, disconnect, getConnectionDescription, isConnected, validateConnection
 
Methods inherited from interface org.mule.api.lifecycle.Initialisable
initialise
 
Methods inherited from interface org.mule.api.lifecycle.Startable
start
 
Methods inherited from interface org.mule.api.lifecycle.Stoppable
stop
 
Methods inherited from interface org.mule.api.lifecycle.Disposable
dispose
 
Methods inherited from interface org.mule.api.lifecycle.LifecycleStateEnabled
getLifecycleState
 

Constructor Detail

JmsMessageDispatcher

public JmsMessageDispatcher(OutboundEndpoint endpoint)
Method Detail

doDispatch

protected void doDispatch(MuleEvent event)
                   throws Exception
Specified by:
doDispatch in class AbstractMessageDispatcher
Throws:
Exception

doConnect

protected void doConnect()
                  throws Exception
Overrides:
doConnect in class AbstractTransportMessageHandler
Throws:
Exception

doDisconnect

protected void doDisconnect()
                     throws Exception
Overrides:
doDisconnect in class AbstractTransportMessageHandler
Throws:
Exception

isDisableTemporaryDestinations

protected boolean isDisableTemporaryDestinations()

createMessageWithJmsMessagePayload

protected MuleMessage createMessageWithJmsMessagePayload(Message jmsMessage)
                                                  throws Exception
Throws:
Exception

preTransformMessage

protected void preTransformMessage(MuleMessage message)
                            throws Exception
This method is called before the current message is transformed. It can be used to do any message body or header processing before the transformer is called.

Parameters:
message - the current MuleMessage Being processed
Throws:
Exception

handleMultiTx

@Deprecated
protected void handleMultiTx(Session session)
                      throws Exception
Deprecated. 

Throws:
Exception

doSend

protected MuleMessage doSend(MuleEvent event)
                      throws Exception
Specified by:
doSend in class AbstractMessageDispatcher
Throws:
Exception

doDispose

protected void doDispose()
Overrides:
doDispose in class AbstractTransportMessageHandler

processMessage

protected void processMessage(Message msg,
                              MuleEvent event)
                       throws JMSException
This method is called once the JMS message is created. It allows subclasses to alter the message if necessary.

Parameters:
msg - The JMS message that will be sent
event - the current event
Throws:
JMSException - if the JmsMessage cannot be written to, this should not happen because the JMSMessage passed in will always be newly created

isHandleReplyTo

protected boolean isHandleReplyTo(Message msg,
                                  MuleEvent event)
                           throws JMSException
Some JMS implementations do not support ReplyTo or require some further fiddling of the message

Parameters:
msg - The JMS message that will be sent
event - the current event
Returns:
true if this request should honour any JMSReplyTo settings on the message
Throws:
JMSException - if the JmsMessage cannot be written to, this should not happen because the JMSMessage passed in will always be newly created

createReplyToConsumer

protected MessageConsumer createReplyToConsumer(Message currentMessage,
                                                MuleEvent event,
                                                Session session,
                                                Destination replyTo,
                                                boolean topic)
                                         throws JMSException
Throws:
JMSException

getReplyToDestination

protected Destination getReplyToDestination(Message message,
                                            Session session,
                                            MuleEvent event,
                                            boolean remoteSync,
                                            boolean topic)
                                     throws JMSException,
                                            EndpointException,
                                            InitialisationException
Throws:
JMSException
EndpointException
InitialisationException

applyOutboundTransformers

protected void applyOutboundTransformers(MuleEvent event)
                                  throws MuleException
Overrides:
applyOutboundTransformers in class AbstractMessageDispatcher
Throws:
MuleException


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