Package org.apache.xmlrpc.server
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 ofXmlRpcServerwith support for reading requests from a stream and writing the response to another stream.
-
-
Field Summary
Fields Modifier and Type Field Description private XmlRpcErrorLoggererrorLoggerprivate static org.apache.commons.logging.Loglogprivate static XmlRpcErrorLoggertheErrorLoggerprivate XmlWriterFactorywriterFactory
-
Constructor Summary
Constructors Constructor Description XmlRpcStreamServer()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected java.lang.ThrowableconvertThrowable(java.lang.Throwable pError)This method allows to convert the error into another error.voidexecute(XmlRpcStreamRequestConfig pConfig, ServerStreamConnection pConnection)Returns, whether the /** Processes a "connection".XmlRpcErrorLoggergetErrorLogger()Returns the error logger.protected java.io.InputStreamgetInputStream(XmlRpcStreamRequestConfig pConfig, ServerStreamConnection pConnection)protected java.io.OutputStreamgetOutputStream(ServerStreamConnection pConnection, XmlRpcStreamRequestConfig pConfig, java.io.OutputStream pStream)Called to prepare the output stream.protected java.io.OutputStreamgetOutputStream(XmlRpcStreamRequestConfig pConfig, ServerStreamConnection pConnection, int pSize)Called to prepare the output stream, if content length is required.protected XmlRpcRequestgetRequest(XmlRpcStreamRequestConfig pConfig, java.io.InputStream pStream)protected XmlRpcWritergetXmlRpcWriter(XmlRpcStreamRequestConfig pConfig, java.io.OutputStream pStream)XmlWriterFactorygetXMLWriterFactory()Returns the XML Writer factory.protected booleanisContentLengthRequired(XmlRpcStreamRequestConfig pConfig)Returns, whether the requests content length is required.protected voidlogError(java.lang.Throwable t)voidsetErrorLogger(XmlRpcErrorLogger pErrorLogger)Sets the error logger.voidsetXMLWriterFactory(XmlWriterFactory pFactory)Sets the XML Writer factory.protected voidwriteError(XmlRpcStreamRequestConfig pConfig, java.io.OutputStream pStream, java.lang.Throwable pError)protected voidwriteResponse(XmlRpcStreamRequestConfig pConfig, java.io.OutputStream pStream, java.lang.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
getMaxThreads, getTypeFactory, getWorkerFactory, setMaxThreads, setTypeFactory, setWorkerFactory
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.apache.xmlrpc.common.XmlRpcRequestProcessor
execute, getTypeConverterFactory
-
-
-
-
Field Detail
-
log
private static final org.apache.commons.logging.Log log
-
writerFactory
private XmlWriterFactory writerFactory
-
theErrorLogger
private static final XmlRpcErrorLogger theErrorLogger
-
errorLogger
private XmlRpcErrorLogger errorLogger
-
-
Method Detail
-
getRequest
protected XmlRpcRequest getRequest(XmlRpcStreamRequestConfig pConfig, java.io.InputStream pStream) throws XmlRpcException
- Throws:
XmlRpcException
-
getXmlRpcWriter
protected XmlRpcWriter getXmlRpcWriter(XmlRpcStreamRequestConfig pConfig, java.io.OutputStream pStream) throws XmlRpcException
- Throws:
XmlRpcException
-
writeResponse
protected void writeResponse(XmlRpcStreamRequestConfig pConfig, java.io.OutputStream pStream, java.lang.Object pResult) throws XmlRpcException
- Throws:
XmlRpcException
-
convertThrowable
protected java.lang.Throwable convertThrowable(java.lang.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.
-
writeError
protected void writeError(XmlRpcStreamRequestConfig pConfig, java.io.OutputStream pStream, java.lang.Throwable pError) throws XmlRpcException
- Throws:
XmlRpcException
-
setXMLWriterFactory
public void setXMLWriterFactory(XmlWriterFactory pFactory)
Sets the XML Writer factory.- Parameters:
pFactory- The XML Writer factory.
-
getXMLWriterFactory
public XmlWriterFactory getXMLWriterFactory()
Returns the XML Writer factory.- Returns:
- The XML Writer factory.
-
getInputStream
protected java.io.InputStream getInputStream(XmlRpcStreamRequestConfig pConfig, ServerStreamConnection pConnection) throws java.io.IOException
- Throws:
java.io.IOException
-
getOutputStream
protected java.io.OutputStream getOutputStream(ServerStreamConnection pConnection, XmlRpcStreamRequestConfig pConfig, java.io.OutputStream pStream) throws java.io.IOException
Called to prepare the output stream. Typically used for enabling compression, or similar filters.- Parameters:
pConnection- The connection object.- Throws:
java.io.IOException
-
getOutputStream
protected java.io.OutputStream getOutputStream(XmlRpcStreamRequestConfig pConfig, ServerStreamConnection pConnection, int pSize) throws java.io.IOException
Called to prepare the output stream, if content length is required.- Parameters:
pConfig- The configuration object.pSize- The requests size.- Throws:
java.io.IOException
-
isContentLengthRequired
protected boolean isContentLengthRequired(XmlRpcStreamRequestConfig pConfig)
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
protected void logError(java.lang.Throwable t)
-
getErrorLogger
public XmlRpcErrorLogger getErrorLogger()
Returns the error logger.
-
setErrorLogger
public void setErrorLogger(XmlRpcErrorLogger pErrorLogger)
Sets the error logger.
-
-