org.apache.camel.component.jms
Class EndpointMessageListener

java.lang.Object
  extended by org.apache.camel.component.jms.EndpointMessageListener
All Implemented Interfaces:
javax.jms.MessageListener

public class EndpointMessageListener
extends Object
implements javax.jms.MessageListener

A JMS MessageListener which can be used to delegate processing to a Camel endpoint. Note that instance of this object has to be thread safe (reentrant)

Version:

Constructor Summary
EndpointMessageListener(JmsEndpoint endpoint, Processor processor)
           
 
Method Summary
 Exchange createExchange(javax.jms.Message message, Object replyDestination)
           
protected  String determineCorrelationId(javax.jms.Message message)
          Strategy to determine which correlation id to use among JMSMessageID and JMSCorrelationID.
 JmsBinding getBinding()
           
 ExceptionHandler getExceptionHandler()
           
 Object getReplyToDestination()
           
protected  Object getReplyToDestination(javax.jms.Message message)
           
 org.springframework.jms.core.JmsOperations getTemplate()
           
protected  void handleException(Throwable t)
          Handles the given exception using the getExceptionHandler()
 boolean isDisableReplyTo()
           
 boolean isEagerLoadingOfProperties()
           
 void onMessage(javax.jms.Message message)
           
protected  void sendReply(javax.jms.Destination replyDestination, javax.jms.Message message, Exchange exchange, Message out, Exception cause)
           
protected  void sendReply(String replyDestination, javax.jms.Message message, Exchange exchange, Message out, Exception cause)
           
 void setBinding(JmsBinding binding)
          Sets the binding used to convert from a Camel message to and from a JMS message
 void setDisableReplyTo(boolean disableReplyTo)
          Allows the reply-to behaviour to be disabled
 void setEagerLoadingOfProperties(boolean eagerLoadingOfProperties)
           
 void setExceptionHandler(ExceptionHandler exceptionHandler)
           
 void setReplyToDestination(Object replyToDestination)
          Provides an explicit reply to destination which overrides any incoming value of Message.getJMSReplyTo()
 void setTemplate(org.springframework.jms.core.JmsOperations template)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

EndpointMessageListener

public EndpointMessageListener(JmsEndpoint endpoint,
                               Processor processor)
Method Detail

onMessage

public void onMessage(javax.jms.Message message)
Specified by:
onMessage in interface javax.jms.MessageListener

createExchange

public Exchange createExchange(javax.jms.Message message,
                               Object replyDestination)

getBinding

public JmsBinding getBinding()

setBinding

public void setBinding(JmsBinding binding)
Sets the binding used to convert from a Camel message to and from a JMS message

Parameters:
binding - the binding to use

getExceptionHandler

public ExceptionHandler getExceptionHandler()

setExceptionHandler

public void setExceptionHandler(ExceptionHandler exceptionHandler)

isEagerLoadingOfProperties

public boolean isEagerLoadingOfProperties()

setEagerLoadingOfProperties

public void setEagerLoadingOfProperties(boolean eagerLoadingOfProperties)

getTemplate

public org.springframework.jms.core.JmsOperations getTemplate()

setTemplate

public void setTemplate(org.springframework.jms.core.JmsOperations template)

isDisableReplyTo

public boolean isDisableReplyTo()

setDisableReplyTo

public void setDisableReplyTo(boolean disableReplyTo)
Allows the reply-to behaviour to be disabled


getReplyToDestination

public Object getReplyToDestination()

setReplyToDestination

public void setReplyToDestination(Object replyToDestination)
Provides an explicit reply to destination which overrides any incoming value of Message.getJMSReplyTo()

Parameters:
replyToDestination - the destination that should be used to send replies to as either a String or Destination type.

determineCorrelationId

protected String determineCorrelationId(javax.jms.Message message)
                                 throws javax.jms.JMSException
Strategy to determine which correlation id to use among JMSMessageID and JMSCorrelationID.

Parameters:
message - the JMS message
Returns:
the correlation id to use
Throws:
javax.jms.JMSException - can be thrown

sendReply

protected void sendReply(javax.jms.Destination replyDestination,
                         javax.jms.Message message,
                         Exchange exchange,
                         Message out,
                         Exception cause)

sendReply

protected void sendReply(String replyDestination,
                         javax.jms.Message message,
                         Exchange exchange,
                         Message out,
                         Exception cause)

getReplyToDestination

protected Object getReplyToDestination(javax.jms.Message message)
                                throws javax.jms.JMSException
Throws:
javax.jms.JMSException

handleException

protected void handleException(Throwable t)
Handles the given exception using the getExceptionHandler()

Parameters:
t - the exception to handle


Apache CAMEL