Class JMSConduit

All Implemented Interfaces:
jakarta.jms.MessageListener, Conduit, Observable

public class JMSConduit extends 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.
  • Constructor Details

    • JMSConduit

      public JMSConduit(org.apache.cxf.ws.addressing.EndpointReferenceType target, JMSConfiguration jmsConfig, Bus b)
  • Method Details

    • prepare

      public void prepare(Message message) throws IOException
      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. Prepare the message for sending. This will typically involve setting an OutputStream on the message, but it may do nothing at all.
      Specified by:
      prepare in interface Conduit
      Parameters:
      message - the message to be sent.
      Throws:
      IOException
    • close

      public void close(Message msg) throws IOException
      Description copied from interface: Conduit
      Close the connections associated with the message
      Specified by:
      close in interface Conduit
      Overrides:
      close in class AbstractConduit
      Parameters:
      msg - for which content should be closed.
      Throws:
      IOException
    • sendExchange

      public void sendExchange(Exchange exchange, Object request)
      Send the JMS message and if the MEP is not oneway receive the response.
      Parameters:
      exchange - the Exchange containing the outgoing message
      request - 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:
      onMessage in interface jakarta.jms.MessageListener
    • processReplyMessage

      protected void processReplyMessage(Exchange exchange, jakarta.jms.Message jmsMessage) throws jakarta.jms.JMSException
      Process the reply message
      Throws:
      jakarta.jms.JMSException
    • close

      public void close()
      Description copied from class: AbstractConduit
      Close the conduit.
      Specified by:
      close in interface Conduit
      Overrides:
      close in class AbstractConduit
    • 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)
    • isSetReplyTo

      protected static boolean isSetReplyTo(Message message)
    • finalize

      protected void finalize() throws Throwable
      Overrides:
      finalize in class Object
      Throws:
      Throwable