Apache CXF API

org.apache.cxf.transport.jms
Class JMSDestination

java.lang.Object
  extended by org.apache.cxf.transport.AbstractObservable
      extended by org.apache.cxf.transport.AbstractDestination
          extended by org.apache.cxf.transport.AbstractMultiplexDestination
              extended by org.apache.cxf.transport.jms.JMSDestination
All Implemented Interfaces:
javax.jms.MessageListener, Destination, DestinationWithEndpoint, MultiplexDestination, Observable, org.springframework.jms.listener.SessionAwareMessageListener

public class JMSDestination
extends AbstractMultiplexDestination
implements org.springframework.jms.listener.SessionAwareMessageListener, javax.jms.MessageListener


Nested Class Summary
protected  class JMSDestination.BackChannelConduit
          Conduit for sending the reply back to the client
 
Nested classes/interfaces inherited from class org.apache.cxf.transport.AbstractDestination
AbstractDestination.AbstractBackChannelConduit
 
Field Summary
 
Fields inherited from class org.apache.cxf.transport.AbstractDestination
endpointInfo, reference
 
Fields inherited from class org.apache.cxf.transport.AbstractObservable
incomingObserver
 
Constructor Summary
JMSDestination(Bus b, EndpointInfo info, JMSConfiguration jmsConfig)
           
 
Method Summary
 void activate()
          Initialize jmsTemplate and jmsListener from jms configuration data in jmsConfig Activate messages flow.
 void deactivate()
          Deactivate messages flow.
 String determineCorrelationID(javax.jms.Message request)
          Decides what correlationId to use for the reply by looking at the request headers.
protected  Conduit getInbuiltBackChannel(Message inMessage)
           
 JMSConfiguration getJmsConfig()
           
protected  Logger getLogger()
           
 javax.jms.Destination getReplyToDestination(org.springframework.jms.core.JmsTemplate jmsTemplate, Message inMessage)
           
 void onMessage(javax.jms.Message message)
          Convert JMS message received by ListenerThread to CXF message and inform incomingObserver that a message was received.
 void onMessage(javax.jms.Message message, javax.jms.Session session)
           
 void sendExchange(Exchange exchange, Object replyObj)
          Is called from JMSOutputStream.doClose() when the stream is fully written.
 void setJmsConfig(JMSConfiguration jmsConfig)
           
 void shutdown()
          Shutdown the Destination, i.e.
 
Methods inherited from class org.apache.cxf.transport.AbstractMultiplexDestination
getAddressWithId, getId
 
Methods inherited from class org.apache.cxf.transport.AbstractDestination
getAddress, getBackChannel, getEndpointInfo
 
Methods inherited from class org.apache.cxf.transport.AbstractObservable
getMessageObserver, getTargetReference, getTargetReference, setMessageObserver
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.apache.cxf.transport.Destination
getAddress, getBackChannel, getMessageObserver
 
Methods inherited from interface org.apache.cxf.transport.Observable
setMessageObserver
 

Constructor Detail

JMSDestination

public JMSDestination(Bus b,
                      EndpointInfo info,
                      JMSConfiguration jmsConfig)
Method Detail

getInbuiltBackChannel

protected Conduit getInbuiltBackChannel(Message inMessage)
Specified by:
getInbuiltBackChannel in class AbstractDestination
Parameters:
inMessage - the incoming message
Returns:
the inbuilt backchannel

activate

public void activate()
Initialize jmsTemplate and jmsListener from jms configuration data in jmsConfig Activate messages flow.

Overrides:
activate in class AbstractObservable

deactivate

public void deactivate()
Description copied from class: AbstractObservable
Deactivate messages flow.

Overrides:
deactivate in class AbstractObservable

shutdown

public void shutdown()
Description copied from class: AbstractDestination
Shutdown the Destination, i.e. stop accepting incoming messages.

Specified by:
shutdown in interface Destination
Overrides:
shutdown in class AbstractDestination

getReplyToDestination

public javax.jms.Destination getReplyToDestination(org.springframework.jms.core.JmsTemplate jmsTemplate,
                                                   Message inMessage)
                                            throws javax.jms.JMSException
Throws:
javax.jms.JMSException

determineCorrelationID

public String determineCorrelationID(javax.jms.Message request)
                              throws javax.jms.JMSException
Decides what correlationId to use for the reply by looking at the request headers. If the request has a correlationId set this is taken. Else the messageId from the request message is used as correlation Id

Parameters:
request -
Returns:
Throws:
javax.jms.JMSException

onMessage

public void onMessage(javax.jms.Message message)
Convert JMS message received by ListenerThread to CXF message and inform incomingObserver that a message was received. The observer will call the service and then send the response CXF message by using the BackChannelConduit

Specified by:
onMessage in interface javax.jms.MessageListener
Parameters:
message -
Throws:
IOException

onMessage

public void onMessage(javax.jms.Message message,
                      javax.jms.Session session)
Specified by:
onMessage in interface org.springframework.jms.listener.SessionAwareMessageListener

sendExchange

public void sendExchange(Exchange exchange,
                         Object replyObj)
Is called from JMSOutputStream.doClose() when the stream is fully written. Sends the outMessage of the given exchange with the given payload from the JMSOutputStream. If the exchange is not oneway a reply should be recieved and set as inMessage


getLogger

protected Logger getLogger()
Specified by:
getLogger in class AbstractObservable
Returns:
the logger to use

getJmsConfig

public JMSConfiguration getJmsConfig()

setJmsConfig

public void setJmsConfig(JMSConfiguration jmsConfig)

Apache CXF API

Apache CXF