org.springframework.ws.transport.jms
Class JmsReceiverConnection

java.lang.Object
  extended by org.springframework.ws.transport.AbstractWebServiceConnection
      extended by org.springframework.ws.transport.AbstractReceiverConnection
          extended by org.springframework.ws.transport.jms.JmsReceiverConnection
All Implemented Interfaces:
WebServiceConnection

public class JmsReceiverConnection
extends 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

Constructor Summary
protected JmsReceiverConnection(javax.jms.BytesMessage requestMessage, javax.jms.Session session)
          Constructs a new JMS connection with the given BytesMessage.
protected JmsReceiverConnection(javax.jms.TextMessage requestMessage, String encoding, javax.jms.Session session)
          Constructs a new JMS connection with the given TextMessage.
 
Method Summary
protected  void addResponseHeader(String name, String value)
           
 String getErrorMessage()
           
protected  Iterator<String> getRequestHeaderNames()
           
protected  Iterator<String> getRequestHeaders(String name)
           
protected  InputStream getRequestInputStream()
           
 javax.jms.Message getRequestMessage()
          Returns the request message for this connection.
 javax.jms.Message getResponseMessage()
          Returns the response message, if any, for this connection.
protected  OutputStream getResponseOutputStream()
           
 URI getUri()
           
 boolean hasError()
           
protected  void onSendAfterWrite(WebServiceMessage message)
           
protected  void onSendBeforeWrite(WebServiceMessage message)
           
 
Methods inherited from class org.springframework.ws.transport.AbstractReceiverConnection
createTransportInputStream, createTransportOutputStream, onClose
 
Methods inherited from class org.springframework.ws.transport.AbstractWebServiceConnection
close, onReceiveAfterRead, onReceiveBeforeRead, receive, send
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JmsReceiverConnection

protected JmsReceiverConnection(javax.jms.BytesMessage requestMessage,
                                javax.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(javax.jms.TextMessage requestMessage,
                                String encoding,
                                javax.jms.Session session)
Constructs a new JMS connection with the given TextMessage.

Parameters:
requestMessage - the JMS request message
session - the JMS session
Method Detail

getRequestMessage

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


getResponseMessage

public javax.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

protected Iterator<String> getRequestHeaderNames()
                                          throws IOException
Specified by:
getRequestHeaderNames in class AbstractReceiverConnection
Throws:
IOException

getRequestHeaders

protected Iterator<String> getRequestHeaders(String name)
                                      throws IOException
Specified by:
getRequestHeaders in class AbstractReceiverConnection
Throws:
IOException

getRequestInputStream

protected InputStream getRequestInputStream()
                                     throws IOException
Specified by:
getRequestInputStream in class AbstractReceiverConnection
Throws:
IOException

onSendBeforeWrite

protected void onSendBeforeWrite(WebServiceMessage message)
                          throws IOException
Overrides:
onSendBeforeWrite in class AbstractWebServiceConnection
Throws:
IOException

addResponseHeader

protected void addResponseHeader(String name,
                                 String value)
                          throws IOException
Specified by:
addResponseHeader in class AbstractReceiverConnection
Throws:
IOException

getResponseOutputStream

protected OutputStream getResponseOutputStream()
                                        throws IOException
Specified by:
getResponseOutputStream in class AbstractReceiverConnection
Throws:
IOException

onSendAfterWrite

protected void onSendAfterWrite(WebServiceMessage message)
                         throws IOException
Overrides:
onSendAfterWrite in class AbstractWebServiceConnection
Throws:
IOException


Copyright © 2013 The Spring Web Services Framework. All Rights Reserved.