org.apache.xmlrpc.client
Class XmlRpcStreamTransport

java.lang.Object
  extended by org.apache.xmlrpc.client.XmlRpcTransportImpl
      extended by org.apache.xmlrpc.client.XmlRpcStreamTransport
All Implemented Interfaces:
XmlRpcTransport
Direct Known Subclasses:
XmlRpcHttpTransport, XmlRpcLocalStreamTransport

public abstract class XmlRpcStreamTransport
extends XmlRpcTransportImpl

Implementation of a transport class, which is based on an output stream for sending the request and an input stream for receiving the response,


Nested Class Summary
protected  class XmlRpcStreamTransport.GzipReqWriter
           
protected static interface XmlRpcStreamTransport.ReqWriter
           
protected  class XmlRpcStreamTransport.ReqWriterImpl
           
 
Constructor Summary
protected XmlRpcStreamTransport(XmlRpcClient pClient)
          Creates a new instance on behalf of the given client.
 
Method Summary
protected abstract  void close()
          Closes the connection and ensures, that all resources are being released.
protected abstract  InputStream getInputStream()
          Returns the input stream, from which the response is being read.
protected  boolean isCompressingRequest(XmlRpcStreamRequestConfig pConfig)
           
protected abstract  boolean isResponseGzipCompressed(XmlRpcStreamRequestConfig pConfig)
          Returns, whether the response is gzip compressed.
protected  XmlRpcStreamTransport.ReqWriter newReqWriter(XmlRpcRequest pRequest)
          Creates a new instance of XmlRpcStreamTransport.ReqWriter.
protected  XMLReader newXMLReader()
           
protected  Object readResponse(XmlRpcStreamRequestConfig pConfig, InputStream pStream)
           
 Object sendRequest(XmlRpcRequest pRequest)
          Send an XML-RPC message.
protected abstract  void writeRequest(XmlRpcStreamTransport.ReqWriter pWriter)
           
 
Methods inherited from class org.apache.xmlrpc.client.XmlRpcTransportImpl
getClient
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

XmlRpcStreamTransport

protected XmlRpcStreamTransport(XmlRpcClient pClient)
Creates a new instance on behalf of the given client.

Method Detail

close

protected abstract void close()
                       throws XmlRpcClientException
Closes the connection and ensures, that all resources are being released.

Throws:
XmlRpcClientException

isResponseGzipCompressed

protected abstract boolean isResponseGzipCompressed(XmlRpcStreamRequestConfig pConfig)
Returns, whether the response is gzip compressed.

Parameters:
pConfig - The clients configuration.
Returns:
Whether the response stream is gzip compressed.

getInputStream

protected abstract InputStream getInputStream()
                                       throws XmlRpcException
Returns the input stream, from which the response is being read.

Throws:
XmlRpcException

isCompressingRequest

protected boolean isCompressingRequest(XmlRpcStreamRequestConfig pConfig)

newReqWriter

protected XmlRpcStreamTransport.ReqWriter newReqWriter(XmlRpcRequest pRequest)
                                                throws XmlRpcException,
                                                       IOException,
                                                       SAXException
Creates a new instance of XmlRpcStreamTransport.ReqWriter.

Throws:
XmlRpcException - Creating the instance failed.
IOException - Creating the instance failed, because an IOException occurs.
SAXException - Creating the instance failed, because the request could not be parsed.

writeRequest

protected abstract void writeRequest(XmlRpcStreamTransport.ReqWriter pWriter)
                              throws XmlRpcException,
                                     IOException,
                                     SAXException
Throws:
XmlRpcException
IOException
SAXException

sendRequest

public Object sendRequest(XmlRpcRequest pRequest)
                   throws XmlRpcException
Description copied from interface: XmlRpcTransport
Send an XML-RPC message. This method is called to send a message to the other party.

Parameters:
pRequest - The request being performed.
Returns:
Result object, if invoking the remote method was successfull.
Throws:
XmlRpcException - Performing the request failed.

newXMLReader

protected XMLReader newXMLReader()
                          throws XmlRpcException
Throws:
XmlRpcException

readResponse

protected Object readResponse(XmlRpcStreamRequestConfig pConfig,
                              InputStream pStream)
                       throws XmlRpcException
Throws:
XmlRpcException


Copyright © 2001-2007 Apache Software Foundation. All Rights Reserved.