Class XmlRpcStreamServer
java.lang.Object
org.apache.xmlrpc.common.XmlRpcController
org.apache.xmlrpc.server.XmlRpcServer
org.apache.xmlrpc.server.XmlRpcStreamServer
- All Implemented Interfaces:
XmlRpcRequestProcessor, XmlRpcStreamRequestProcessor
- Direct Known 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.-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate XmlRpcErrorLoggerprivate static final org.apache.commons.logging.Logprivate static final XmlRpcErrorLoggerprivate XmlWriterFactory -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected ThrowableconvertThrowable(Throwable pError) This method allows to convert the error into another error.voidexecute(XmlRpcStreamRequestConfig pConfig, ServerStreamConnection pConnection) Returns, whether the /** Processes a "connection".Returns the error logger.protected InputStreamgetInputStream(XmlRpcStreamRequestConfig pConfig, ServerStreamConnection pConnection) protected OutputStreamgetOutputStream(ServerStreamConnection pConnection, XmlRpcStreamRequestConfig pConfig, OutputStream pStream) Called to prepare the output stream.protected OutputStreamgetOutputStream(XmlRpcStreamRequestConfig pConfig, ServerStreamConnection pConnection, int pSize) Called to prepare the output stream, if content length is required.protected XmlRpcRequestgetRequest(XmlRpcStreamRequestConfig pConfig, InputStream pStream) protected XmlRpcWritergetXmlRpcWriter(XmlRpcStreamRequestConfig pConfig, OutputStream pStream) Returns the XML Writer factory.protected booleanReturns, whether the requests content length is required.protected voidvoidsetErrorLogger(XmlRpcErrorLogger pErrorLogger) Sets the error logger.voidsetXMLWriterFactory(XmlWriterFactory pFactory) Sets the XML Writer factory.protected voidwriteError(XmlRpcStreamRequestConfig pConfig, OutputStream pStream, Throwable pError) protected voidwriteResponse(XmlRpcStreamRequestConfig pConfig, OutputStream pStream, Object pResult) Methods inherited from class XmlRpcServer
execute, getConfig, getDefaultXmlRpcWorkerFactory, getHandlerMapping, getTypeConverterFactory, setConfig, setHandlerMapping, setTypeConverterFactoryMethods inherited from class XmlRpcController
getMaxThreads, getTypeFactory, getWorkerFactory, setMaxThreads, setTypeFactory, setWorkerFactoryMethods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface XmlRpcRequestProcessor
execute, getTypeConverterFactory
-
Field Details
-
log
private static final org.apache.commons.logging.Log log -
writerFactory
-
theErrorLogger
-
errorLogger
-
-
Constructor Details
-
XmlRpcStreamServer
public XmlRpcStreamServer()
-
-
Method Details
-
getRequest
protected XmlRpcRequest getRequest(XmlRpcStreamRequestConfig pConfig, InputStream pStream) throws XmlRpcException - Throws:
XmlRpcException
-
getXmlRpcWriter
protected XmlRpcWriter getXmlRpcWriter(XmlRpcStreamRequestConfig pConfig, OutputStream pStream) throws XmlRpcException - Throws:
XmlRpcException
-
writeResponse
protected void writeResponse(XmlRpcStreamRequestConfig pConfig, OutputStream pStream, Object pResult) throws XmlRpcException - Throws:
XmlRpcException
-
convertThrowable
-
writeError
protected void writeError(XmlRpcStreamRequestConfig pConfig, OutputStream pStream, Throwable pError) throws XmlRpcException - Throws:
XmlRpcException
-
setXMLWriterFactory
Sets the XML Writer factory.- Parameters:
pFactory- The XML Writer factory.
-
getXMLWriterFactory
Returns the XML Writer factory.- Returns:
- The XML Writer factory.
-
getInputStream
protected InputStream getInputStream(XmlRpcStreamRequestConfig pConfig, ServerStreamConnection pConnection) throws IOException - 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.- Parameters:
pConnection- The connection object.- Throws:
IOException
-
getOutputStream
protected OutputStream getOutputStream(XmlRpcStreamRequestConfig pConfig, ServerStreamConnection pConnection, int pSize) throws IOException Called to prepare the output stream, if content length is required.- Parameters:
pConfig- The configuration object.pSize- The requests size.- Throws:
IOException
-
isContentLengthRequired
Returns, whether the requests content length is required.- Parameters:
pConfig- The configuration object.
-
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:
executein interfaceXmlRpcStreamRequestProcessor- Parameters:
pConfig- The request configuration.pConnection- The "connection" being processed.- Throws:
XmlRpcException- Processing the request failed.
-
logError
-
getErrorLogger
Returns the error logger. -
setErrorLogger
Sets the error logger.
-