Spring Web Services Framework

org.springframework.ws.transport
Class AbstractSenderConnection

java.lang.Object
  extended by org.springframework.ws.transport.AbstractWebServiceConnection
      extended by org.springframework.ws.transport.AbstractSenderConnection
All Implemented Interfaces:
WebServiceConnection
Direct Known Subclasses:
AbstractHttpSenderConnection, JmsSenderConnection, MailSenderConnection, XmppSenderConnection

public abstract class AbstractSenderConnection
extends AbstractWebServiceConnection

Abstract base class for WebServiceConnection implementations used for sending requests.

Since:
1.0.0
Author:
Arjen Poutsma

Constructor Summary
AbstractSenderConnection()
           
 
Method Summary
protected abstract  void addRequestHeader(String name, String value)
          Adds a request 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  OutputStream getRequestOutputStream()
          Returns the output stream to write the request to.
protected abstract  Iterator<String> getResponseHeaderNames()
          Returns an iteration over all the header names this request contains.
protected abstract  Iterator<String> getResponseHeaders(String name)
          Returns an iteration over all the string values of the specified header.
protected abstract  InputStream getResponseInputStream()
          Returns the input stream to read the response from.
protected abstract  boolean hasResponse()
          Indicates whether this connection has a response.
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

AbstractSenderConnection

public AbstractSenderConnection()
Method Detail

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

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

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

hasResponse

protected abstract boolean hasResponse()
                                throws IOException
Indicates whether this connection has a response.

Throws:
IOException

addRequestHeader

protected abstract void addRequestHeader(String name,
                                         String value)
                                  throws IOException
Adds a request 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

getRequestOutputStream

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

Throws:
IOException

getResponseHeaderNames

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

Throws:
IOException

getResponseHeaders

protected abstract Iterator<String> getResponseHeaders(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

getResponseInputStream

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

Throws:
IOException

Spring Web Services Framework

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