org.apache.xmlrpc.client

Class XmlRpcStreamTransport

Implemented Interfaces:
XmlRpcTransport
Known Direct 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

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)
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

Constructor Details

XmlRpcStreamTransport

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

Method Details

close

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

getInputStream

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

isCompressingRequest

protected boolean isCompressingRequest(XmlRpcStreamRequestConfig pConfig)

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.

newReqWriter

protected XmlRpcStreamTransport.ReqWriter newReqWriter(XmlRpcRequest pRequest)
            throws XmlRpcException,
                   IOException,
                   SAXException

newXMLReader

protected XMLReader newXMLReader()
            throws XmlRpcException

readResponse

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

sendRequest

public Object sendRequest(XmlRpcRequest pRequest)
            throws XmlRpcException
Send an XML-RPC message. This method is called to send a message to the other party.
Specified by:
sendRequest in interface XmlRpcTransport
Parameters:
pRequest - The request being performed.
Returns:
Result object, if invoking the remote method was successfull.
Throws:
XmlRpcException - Performing the request failed.

writeRequest

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

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