org.apache.xmlrpc

Class XmlRpcResponseProcessor

public class XmlRpcResponseProcessor extends Object

Process an Object and produce byte array that represents the specified encoding of the output as an XML-RPC response. This is NOT thread safe.

Since: 1.2

Author: Andrew Evers Hannes Wallnoefer Daniel L. Rall

Field Summary
static byte[]EMPTY_BYTE_ARRAY
Constructor Summary
XmlRpcResponseProcessor()
Creates a new instance.
Method Summary
byte[]encodeException(Exception x, String encoding, int code)
Process an exception, and return output in the specified encoding.
byte[]encodeException(Exception x, String encoding)
Process an exception, and return output in the specified encoding.
byte[]encodeResponse(Object responseParam, String encoding)
Process a successful response, and return output in the specified encoding.
voidwriteError(int code, String message, XmlWriter writer)
Writes an XML-RPC error response to the XML writer.
voidwriteResponse(Object param, XmlWriter writer)
Writes an XML-RPC response to the XML writer.

Field Detail

EMPTY_BYTE_ARRAY

private static final byte[] EMPTY_BYTE_ARRAY

Constructor Detail

XmlRpcResponseProcessor

public XmlRpcResponseProcessor()
Creates a new instance.

Method Detail

encodeException

public byte[] encodeException(Exception x, String encoding, int code)
Process an exception, and return output in the specified encoding.

Parameters: e The exception to process; encoding The output encoding. code The XML-RPC faultCode.

Returns: byte[] The XML-RPC response.

encodeException

public byte[] encodeException(Exception x, String encoding)
Process an exception, and return output in the specified encoding.

Parameters: e The exception to process; encoding The output encoding.

Returns: byte[] The XML-RPC response.

encodeResponse

public byte[] encodeResponse(Object responseParam, String encoding)
Process a successful response, and return output in the specified encoding.

Parameters: responseParam The response to process. encoding The output encoding.

Returns: byte[] The XML-RPC response.

writeError

void writeError(int code, String message, XmlWriter writer)
Writes an XML-RPC error response to the XML writer.

writeResponse

void writeResponse(Object param, XmlWriter writer)
Writes an XML-RPC response to the XML writer.
Copyright B) 1999-2002 Apache Software Foundation. All Rights Reserved.