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 Summary
ConstructorsModifierConstructorDescriptionprotectedJmsReceiverConnection(jakarta.jms.BytesMessage requestMessage, jakarta.jms.Session session) Constructs a new JMS connection with the givenBytesMessage.protectedJmsReceiverConnection(jakarta.jms.TextMessage requestMessage, String encoding, jakarta.jms.Session session) Constructs a new JMS connection with the givenTextMessage. -
Method Summary
Modifier and TypeMethodDescriptionvoidaddResponseHeader(String name, String value) getRequestHeaders(String name) protected InputStreamjakarta.jms.MessageReturns the request message for this connection.jakarta.jms.MessageReturns the response message, if any, for this connection.protected OutputStreamgetUri()booleanhasError()protected voidonSendAfterWrite(org.springframework.ws.WebServiceMessage message) protected voidonSendBeforeWrite(org.springframework.ws.WebServiceMessage message) Methods inherited from class org.springframework.ws.transport.AbstractReceiverConnection
createTransportInputStream, createTransportOutputStream, onCloseMethods inherited from class org.springframework.ws.transport.AbstractWebServiceConnection
close, onReceiveAfterRead, onReceiveBeforeRead, receive, send
-
Constructor Details
-
JmsReceiverConnection
protected JmsReceiverConnection(jakarta.jms.BytesMessage requestMessage, jakarta.jms.Session session) Constructs a new JMS connection with the givenBytesMessage.- Parameters:
requestMessage- the JMS request messagesession- the JMS session
-
JmsReceiverConnection
protected JmsReceiverConnection(jakarta.jms.TextMessage requestMessage, String encoding, jakarta.jms.Session session) Constructs a new JMS connection with the givenTextMessage.- Parameters:
requestMessage- the JMS request messagesession- the JMS session
-
-
Method Details
-
getRequestMessage
public jakarta.jms.Message getRequestMessage()Returns the request message for this connection. Returns either aBytesMessageor aTextMessage. -
getResponseMessage
public jakarta.jms.Message getResponseMessage()Returns the response message, if any, for this connection. Returns either aBytesMessageor aTextMessage. -
getUri
- Throws:
URISyntaxException
-
getErrorMessage
- Throws:
IOException
-
hasError
- Throws:
IOException
-
getRequestHeaderNames
- Throws:
IOException
-
getRequestHeaders
- Throws:
IOException
-
getRequestInputStream
- Specified by:
getRequestInputStreamin classorg.springframework.ws.transport.AbstractReceiverConnection- Throws:
IOException
-
onSendBeforeWrite
protected void onSendBeforeWrite(org.springframework.ws.WebServiceMessage message) throws IOException - Overrides:
onSendBeforeWritein classorg.springframework.ws.transport.AbstractWebServiceConnection- Throws:
IOException
-
addResponseHeader
- Throws:
IOException
-
getResponseOutputStream
- Specified by:
getResponseOutputStreamin classorg.springframework.ws.transport.AbstractReceiverConnection- Throws:
IOException
-
onSendAfterWrite
protected void onSendAfterWrite(org.springframework.ws.WebServiceMessage message) throws IOException - Overrides:
onSendAfterWritein classorg.springframework.ws.transport.AbstractWebServiceConnection- Throws:
IOException
-