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  java.io.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  org.xml.sax.XMLReader newXMLReader()
           
protected  java.lang.Object readResponse(XmlRpcStreamRequestConfig pConfig, java.io.InputStream pStream)
           
 java.lang.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 java.io.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,
                                                       java.io.IOException,
                                                       org.xml.sax.SAXException
Creates a new instance of XmlRpcStreamTransport.ReqWriter.

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

writeRequest

protected abstract void writeRequest(XmlRpcStreamTransport.ReqWriter pWriter)
                              throws XmlRpcException,
                                     java.io.IOException,
                                     org.xml.sax.SAXException
Throws:
XmlRpcException
java.io.IOException
org.xml.sax.SAXException

sendRequest

public java.lang.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 org.xml.sax.XMLReader newXMLReader()
                                      throws XmlRpcException
Throws:
XmlRpcException

readResponse

protected java.lang.Object readResponse(XmlRpcStreamRequestConfig pConfig,
                                        java.io.InputStream pStream)
                                 throws XmlRpcException
Throws:
XmlRpcException


Copyright © 2001-2010 The Apache Software Foundation. All Rights Reserved.