org.apache.cxf.transport.jms
Class JMSDestination
java.lang.Object
org.apache.cxf.transport.AbstractObservable
org.apache.cxf.transport.AbstractDestination
org.apache.cxf.transport.AbstractMultiplexDestination
org.apache.cxf.transport.jms.JMSDestination
- All Implemented Interfaces:
- javax.jms.MessageListener, org.apache.cxf.transport.Destination, org.apache.cxf.transport.DestinationWithEndpoint, org.apache.cxf.transport.MultiplexDestination, org.apache.cxf.transport.Observable
public class JMSDestination
- extends org.apache.cxf.transport.AbstractMultiplexDestination
- implements javax.jms.MessageListener
| Nested classes/interfaces inherited from class org.apache.cxf.transport.AbstractDestination |
org.apache.cxf.transport.AbstractDestination.AbstractBackChannelConduit |
| Fields inherited from class org.apache.cxf.transport.AbstractDestination |
endpointInfo, reference |
| Fields inherited from class org.apache.cxf.transport.AbstractObservable |
incomingObserver |
|
Method Summary |
void |
activate()
Initialize jmsTemplate and jmsListener from jms configuration data in jmsConfig |
void |
deactivate()
|
java.lang.String |
determineCorrelationID(javax.jms.Message request)
Decides what correlationId to use for the reply by looking at the request headers. |
protected org.apache.cxf.transport.Conduit |
getInbuiltBackChannel(org.apache.cxf.message.Message inMessage)
|
JMSConfiguration |
getJmsConfig()
|
protected java.util.logging.Logger |
getLogger()
|
javax.jms.Destination |
getReplyToDestination(org.springframework.jms.core.JmsTemplate jmsTemplate,
org.apache.cxf.message.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 |
sendExchange(org.apache.cxf.message.Exchange exchange,
java.lang.Object replyObj)
Is called from JMSOutputStream.doClose() when the stream is fully
written. |
void |
setJmsConfig(JMSConfiguration jmsConfig)
|
void |
shutdown()
|
| Methods inherited from class org.apache.cxf.transport.AbstractMultiplexDestination |
getAddressWithId, getId |
| Methods inherited from class org.apache.cxf.transport.AbstractDestination |
getAddress, getBackChannel, getConduitInitiator, getEndpointInfo, markPartialResponse |
| 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 |
JMSDestination
public JMSDestination(org.apache.cxf.Bus b,
org.apache.cxf.service.model.EndpointInfo info,
JMSConfiguration jmsConfig)
getInbuiltBackChannel
protected org.apache.cxf.transport.Conduit getInbuiltBackChannel(org.apache.cxf.message.Message inMessage)
- Specified by:
getInbuiltBackChannel in class org.apache.cxf.transport.AbstractDestination
- Parameters:
inMessage - the incoming message
- Returns:
- the inbuilt backchannel
activate
public void activate()
- Initialize jmsTemplate and jmsListener from jms configuration data in jmsConfig
- Overrides:
activate in class org.apache.cxf.transport.AbstractObservable
deactivate
public void deactivate()
- Overrides:
deactivate in class org.apache.cxf.transport.AbstractObservable
shutdown
public void shutdown()
- Specified by:
shutdown in interface org.apache.cxf.transport.Destination- Overrides:
shutdown in class org.apache.cxf.transport.AbstractDestination
getReplyToDestination
public javax.jms.Destination getReplyToDestination(org.springframework.jms.core.JmsTemplate jmsTemplate,
org.apache.cxf.message.Message inMessage)
throws javax.jms.JMSException
- Throws:
javax.jms.JMSException
determineCorrelationID
public java.lang.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:
java.io.IOException
sendExchange
public void sendExchange(org.apache.cxf.message.Exchange exchange,
java.lang.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 java.util.logging.Logger getLogger()
- Specified by:
getLogger in class org.apache.cxf.transport.AbstractObservable
getJmsConfig
public JMSConfiguration getJmsConfig()
setJmsConfig
public void setJmsConfig(JMSConfiguration jmsConfig)
Apache CXF