Spring Web Services Framework

org.springframework.ws.transport
Class AbstractReceiverConnection

java.lang.Object
  extended by org.springframework.ws.transport.AbstractWebServiceConnection
      extended by org.springframework.ws.transport.AbstractReceiverConnection
All Implemented Interfaces:
WebServiceConnection
Direct Known Subclasses:
HttpExchangeConnection, HttpServletConnection, JmsReceiverConnection, MailReceiverConnection, XmppReceiverConnection

public abstract class AbstractReceiverConnection
extends AbstractWebServiceConnection

Abstract base class for WebServiceConnection implementations used for receiving requests.

Since:
1.0.0
Author:
Arjen Poutsma

Constructor Summary
AbstractReceiverConnection()
           
 
Method Summary
protected abstract  void addResponseHeader(String name, String value)
          Adds a response header with the given name and value.
protected  TransportInputStream createTransportInputStream()
          Returns a TransportInputStream.
protected  TransportOutputStream createTransportOutputStream()
          Returns a TransportOutputStream for the given message.
protected abstract  Iterator<String> getRequestHeaderNames()
          Returns an iteration over all the header names this request contains.
protected abstract  Iterator<String> getRequestHeaders(String name)
          Returns an iteration over all the string values of the specified header.
protected abstract  InputStream getRequestInputStream()
          Returns the input stream to read the response from.
protected abstract  OutputStream getResponseOutputStream()
          Returns the output stream to write the request to.
protected  void onClose()
          Template method invoked from AbstractWebServiceConnection.close().
 
Methods inherited from class org.springframework.ws.transport.AbstractWebServiceConnection
close, onReceiveAfterRead, onReceiveBeforeRead, onSendAfterWrite, onSendBeforeWrite, receive, send
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.springframework.ws.transport.WebServiceConnection
getErrorMessage, getUri, hasError
 

Constructor Detail

AbstractReceiverConnection

public AbstractReceiverConnection()
Method Detail

createTransportInputStream

protected final TransportInputStream createTransportInputStream()
                                                         throws IOException
Description copied from class: AbstractWebServiceConnection
Returns a TransportInputStream. Called from AbstractWebServiceConnection.receive(WebServiceMessageFactory).

Specified by:
createTransportInputStream in class AbstractWebServiceConnection
Returns:
the input stream, or null if no response can be read
Throws:
IOException - when an I/O exception occurs

createTransportOutputStream

protected final TransportOutputStream createTransportOutputStream()
                                                           throws IOException
Description copied from class: AbstractWebServiceConnection
Returns a TransportOutputStream for the given message. Called from AbstractWebServiceConnection.send(WebServiceMessage).

Specified by:
createTransportOutputStream in class AbstractWebServiceConnection
Returns:
the output stream
Throws:
IOException - when an I/O exception occurs

onClose

protected void onClose()
                throws IOException
Template method invoked from AbstractWebServiceConnection.close(). Default implementation is empty.

Overrides:
onClose in class AbstractWebServiceConnection
Throws:
IOException - if an I/O error occurs when closing this connection

getRequestHeaderNames

protected abstract Iterator<String> getRequestHeaderNames()
                                                   throws IOException
Returns an iteration over all the header names this request contains. Returns an empty Iterator if there are no headers.

Throws:
IOException

getRequestHeaders

protected abstract Iterator<String> getRequestHeaders(String name)
                                               throws IOException
Returns an iteration over all the string values of the specified header. Returns an empty Iterator if there are no headers of the specified name.

Throws:
IOException

getRequestInputStream

protected abstract InputStream getRequestInputStream()
                                              throws IOException
Returns the input stream to read the response from.

Throws:
IOException

addResponseHeader

protected abstract void addResponseHeader(String name,
                                          String value)
                                   throws IOException
Adds a response header with the given name and value. This method can be called multiple times, to allow for headers with multiple values.

Parameters:
name - the name of the header
value - the value of the header
Throws:
IOException

getResponseOutputStream

protected abstract OutputStream getResponseOutputStream()
                                                 throws IOException
Returns the output stream to write the request to.

Throws:
IOException

Spring Web Services Framework

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