org.apache.xmlrpc.server

Class XmlRpcStreamServer

Implemented Interfaces:
XmlRpcRequestProcessor, XmlRpcStreamRequestProcessor
Known Direct Subclasses:
XmlRpcHttpServer, XmlRpcLocalStreamServer

public abstract class XmlRpcStreamServer
extends XmlRpcServer
implements XmlRpcStreamRequestProcessor

Extension of XmlRpcServer with support for reading requests from a stream and writing the response to another stream.

Method Summary

protected Throwable
convertThrowable(Throwable pError)
This method allows to convert the error into another error.
void
execute(XmlRpcStreamRequestConfig pConfig, ServerStreamConnection pConnection)
Returns, whether the /** Processes a "connection".
protected InputStream
getInputStream(XmlRpcStreamRequestConfig pConfig, ServerStreamConnection pConnection)
protected OutputStream
getOutputStream(ServerStreamConnection pConnection, XmlRpcStreamRequestConfig pConfig, OutputStream pStream)
Called to prepare the output stream.
protected OutputStream
getOutputStream(XmlRpcStreamRequestConfig pConfig, ServerStreamConnection pConnection, int pSize)
Called to prepare the output stream, if content length is required.
protected XmlRpcRequest
getRequest(XmlRpcStreamRequestConfig pConfig, InputStream pStream)
XmlWriterFactory
getXMLWriterFactory()
Returns the XML Writer factory.
protected XmlRpcWriter
getXmlRpcWriter(XmlRpcStreamRequestConfig pConfig, OutputStream pStream)
protected boolean
isContentLengthRequired(XmlRpcStreamRequestConfig pConfig)
Returns, whether the requests content length is required.
void
setXMLWriterFactory(XmlWriterFactory pFactory)
Sets the XML Writer factory.
protected void
writeError(XmlRpcStreamRequestConfig pConfig, OutputStream pStream, Throwable pError)
protected void
writeResponse(XmlRpcStreamRequestConfig pConfig, OutputStream pStream, Object pResult)

Methods inherited from class org.apache.xmlrpc.server.XmlRpcServer

execute, getConfig, getDefaultXmlRpcWorkerFactory, getHandlerMapping, getTypeConverterFactory, setConfig, setHandlerMapping, setTypeConverterFactory

Methods inherited from class org.apache.xmlrpc.common.XmlRpcController

getConfig, getDefaultXmlRpcWorkerFactory, getMaxThreads, getTypeFactory, getWorkerFactory, setMaxThreads, setTypeFactory, setWorkerFactory

Method Details

convertThrowable

protected Throwable convertThrowable(Throwable pError)
This method allows to convert the error into another error. For example, this may be an error, which could be deserialized by the client.

execute

public void execute(XmlRpcStreamRequestConfig pConfig,
                    ServerStreamConnection pConnection)
            throws XmlRpcException
Returns, whether the /** Processes a "connection". The "connection" is an opaque object, which is being handled by the subclasses.
Specified by:
execute in interface XmlRpcStreamRequestProcessor
Parameters:
pConfig - The request configuration.
pConnection - The "connection" being processed.
Throws:
XmlRpcException - Processing the request failed.

getInputStream

protected InputStream getInputStream(XmlRpcStreamRequestConfig pConfig,
                                     ServerStreamConnection pConnection)
            throws IOException

getOutputStream

protected OutputStream getOutputStream(ServerStreamConnection pConnection,
                                       XmlRpcStreamRequestConfig pConfig,
                                       OutputStream pStream)
            throws IOException
Called to prepare the output stream. Typically used for enabling compression, or similar filters.

getOutputStream

protected OutputStream getOutputStream(XmlRpcStreamRequestConfig pConfig,
                                       ServerStreamConnection pConnection,
                                       int pSize)
            throws IOException
Called to prepare the output stream, if content length is required.

getRequest

protected XmlRpcRequest getRequest(XmlRpcStreamRequestConfig pConfig,
                                   InputStream pStream)
            throws XmlRpcException

getXMLWriterFactory

public XmlWriterFactory getXMLWriterFactory()
Returns the XML Writer factory.
Returns:
The XML Writer factory.

getXmlRpcWriter

protected XmlRpcWriter getXmlRpcWriter(XmlRpcStreamRequestConfig pConfig,
                                       OutputStream pStream)
            throws XmlRpcException

isContentLengthRequired

protected boolean isContentLengthRequired(XmlRpcStreamRequestConfig pConfig)
Returns, whether the requests content length is required.

setXMLWriterFactory

public void setXMLWriterFactory(XmlWriterFactory pFactory)
Sets the XML Writer factory.
Parameters:
pFactory - The XML Writer factory.

writeError

protected void writeError(XmlRpcStreamRequestConfig pConfig,
                          OutputStream pStream,
                          Throwable pError)
            throws XmlRpcException

writeResponse

protected void writeResponse(XmlRpcStreamRequestConfig pConfig,
                             OutputStream pStream,
                             Object pResult)
            throws XmlRpcException

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