Class JmsReceiverConnection

java.lang.Object
org.springframework.ws.transport.AbstractWebServiceConnection
org.springframework.ws.transport.AbstractReceiverConnection
org.springframework.ws.transport.jms.JmsReceiverConnection
All Implemented Interfaces:
AutoCloseable, org.springframework.ws.transport.HeadersAwareReceiverWebServiceConnection, org.springframework.ws.transport.WebServiceConnection

public class JmsReceiverConnection extends org.springframework.ws.transport.AbstractReceiverConnection
Implementation of WebServiceConnection that is used for server-side JMS access. Exposes a BytesMessage or TextMessage request and response message.

The response message type is equal to the request message type, i.e. if a BytesMessage is received as request, a BytesMessage is created as response, and if a TextMessage is received, a TextMessage response is created.

Since:
1.5.0
Author:
Arjen Poutsma, Greg Turnquist
  • Constructor Details

    • JmsReceiverConnection

      protected JmsReceiverConnection(jakarta.jms.BytesMessage requestMessage, jakarta.jms.Session session)
      Constructs a new JMS connection with the given BytesMessage.
      Parameters:
      requestMessage - the JMS request message
      session - the JMS session
    • JmsReceiverConnection

      protected JmsReceiverConnection(jakarta.jms.TextMessage requestMessage, String encoding, jakarta.jms.Session session)
      Constructs a new JMS connection with the given TextMessage.
      Parameters:
      requestMessage - the JMS request message
      session - the JMS session
  • Method Details

    • getRequestMessage

      public jakarta.jms.Message getRequestMessage()
      Returns the request message for this connection. Returns either a BytesMessage or a TextMessage.
    • getResponseMessage

      public jakarta.jms.Message getResponseMessage()
      Returns the response message, if any, for this connection. Returns either a BytesMessage or a TextMessage.
    • getUri

      public URI getUri() throws URISyntaxException
      Throws:
      URISyntaxException
    • getErrorMessage

      public String getErrorMessage() throws IOException
      Throws:
      IOException
    • hasError

      public boolean hasError() throws IOException
      Throws:
      IOException
    • getRequestHeaderNames

      public Iterator<String> getRequestHeaderNames() throws IOException
      Throws:
      IOException
    • getRequestHeaders

      public Iterator<String> getRequestHeaders(String name) throws IOException
      Throws:
      IOException
    • getRequestInputStream

      protected InputStream getRequestInputStream() throws IOException
      Specified by:
      getRequestInputStream in class org.springframework.ws.transport.AbstractReceiverConnection
      Throws:
      IOException
    • onSendBeforeWrite

      protected void onSendBeforeWrite(org.springframework.ws.WebServiceMessage message) throws IOException
      Overrides:
      onSendBeforeWrite in class org.springframework.ws.transport.AbstractWebServiceConnection
      Throws:
      IOException
    • addResponseHeader

      public void addResponseHeader(String name, String value) throws IOException
      Throws:
      IOException
    • getResponseOutputStream

      protected OutputStream getResponseOutputStream() throws IOException
      Specified by:
      getResponseOutputStream in class org.springframework.ws.transport.AbstractReceiverConnection
      Throws:
      IOException
    • onSendAfterWrite

      protected void onSendAfterWrite(org.springframework.ws.WebServiceMessage message) throws IOException
      Overrides:
      onSendAfterWrite in class org.springframework.ws.transport.AbstractWebServiceConnection
      Throws:
      IOException