Package org.apache.cxf.transport.jms
Class JMSConduit
java.lang.Object
org.apache.cxf.transport.AbstractObservable
org.apache.cxf.transport.AbstractConduit
org.apache.cxf.transport.jms.JMSConduit
- All Implemented Interfaces:
jakarta.jms.MessageListener,org.apache.cxf.transport.Conduit,org.apache.cxf.transport.Observable
public class JMSConduit
extends org.apache.cxf.transport.AbstractConduit
implements jakarta.jms.MessageListener
JMSConduit is instantiated by the JMSTransportFactory which is selected by a client if the transport
protocol starts with "jms:". JMSConduit converts CXF Messages to JMS Messages and sends the request
over a queue or a topic.
If the Exchange is not one way it then receives the response and converts it to
a CXF Message. This is then provided in the Exchange and also sent to the IncomingObserver.
-
Field Summary
Fields inherited from class org.apache.cxf.transport.AbstractConduit
targetFields inherited from class org.apache.cxf.transport.AbstractObservable
incomingObserver -
Constructor Summary
ConstructorsConstructorDescriptionJMSConduit(org.apache.cxf.ws.addressing.EndpointReferenceType target, JMSConfiguration jmsConfig, org.apache.cxf.Bus b) -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()voidclose(org.apache.cxf.message.Message msg) protected voidfinalize()protected Loggerprotected static booleanisSetReplyTo(org.apache.cxf.message.Message message) voidonMessage(jakarta.jms.Message jmsMessage) When a message is received on the reply destination the correlation map is searched for the correlationId.voidprepare(org.apache.cxf.message.Message message) Prepare the message to be sent.protected voidprocessReplyMessage(org.apache.cxf.message.Exchange exchange, jakarta.jms.Message jmsMessage) Process the reply messagevoidsendExchange(org.apache.cxf.message.Exchange exchange, Object request) Send the JMS message and if the MEP is not oneway receive the response.voidsetJmsConfig(JMSConfiguration jmsConfig) Methods inherited from class org.apache.cxf.transport.AbstractConduit
getTarget, toStringMethods inherited from class org.apache.cxf.transport.AbstractObservable
activate, deactivate, getMessageObserver, getTargetReference, getTargetReference, setMessageObserverMethods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface org.apache.cxf.transport.Observable
getMessageObserver, setMessageObserver
-
Constructor Details
-
JMSConduit
public JMSConduit(org.apache.cxf.ws.addressing.EndpointReferenceType target, JMSConfiguration jmsConfig, org.apache.cxf.Bus b)
-
-
Method Details
-
prepare
Prepare the message to be sent. The message will be sent after the caller has written the payload to the OutputStream of the message and called the stream's close method. In the JMS case the JMSOutputStream will then call back the sendExchange method of this class.- Specified by:
preparein interfaceorg.apache.cxf.transport.Conduit- Throws:
IOException
-
close
- Specified by:
closein interfaceorg.apache.cxf.transport.Conduit- Overrides:
closein classorg.apache.cxf.transport.AbstractConduit- Throws:
IOException
-
sendExchange
Send the JMS message and if the MEP is not oneway receive the response.- Parameters:
exchange- the Exchange containing the outgoing messagerequest- the payload of the outgoing JMS message
-
onMessage
public void onMessage(jakarta.jms.Message jmsMessage) When a message is received on the reply destination the correlation map is searched for the correlationId. If it is found the message is converted to a CXF message and the thread sending the request is notified- Specified by:
onMessagein interfacejakarta.jms.MessageListener
-
processReplyMessage
protected void processReplyMessage(org.apache.cxf.message.Exchange exchange, jakarta.jms.Message jmsMessage) throws jakarta.jms.JMSException Process the reply message- Throws:
jakarta.jms.JMSException
-
close
public void close()- Specified by:
closein interfaceorg.apache.cxf.transport.Conduit- Overrides:
closein classorg.apache.cxf.transport.AbstractConduit
-
getLogger
- Specified by:
getLoggerin classorg.apache.cxf.transport.AbstractObservable
-
getJmsConfig
-
setJmsConfig
-
isSetReplyTo
protected static boolean isSetReplyTo(org.apache.cxf.message.Message message) -
finalize
-