org.apache.xmlrpc

Class XmlRpcClientResponseProcessor

public class XmlRpcClientResponseProcessor extends XmlRpc

Process an XML-RPC server response from a byte array or an InputStream into an Object. Optionally throw the result object if it is an exception.

Since: 2.0

Version: $Id: XmlRpcClientResponseProcessor.java 350048 2005-11-30 21:49:32 +0100 (Mi, 30 Nov 2005) jochen $

Author: Hannes Wallnoefer Andrew Evers

Field Summary
protected booleanfault
Set to true if a fault occured on the server.
protected Objectresult
The result of the XML-RPC operation.
Constructor Summary
XmlRpcClientResponseProcessor(TimeZone tz)
Creates a new instance.
Method Summary
protected booleancanReUse()
Called by the worker management framework to see if this worker can be re-used.
protected XmlRpcExceptiondecodeException(Object result)
Decode an exception from the result returned from the remote server.
ObjectdecodeResponse(InputStream is)
Decode an XML-RPC response from the specified InputStream.
protected voidobjectParsed(Object what)
voidstartElement(String name, AttributeList atts)
Overrides method in XmlRpc to handle fault repsonses.

Field Detail

fault

protected boolean fault
Set to true if a fault occured on the server.

result

protected Object result
The result of the XML-RPC operation. Possibly an XmlRpcException

Constructor Detail

XmlRpcClientResponseProcessor

public XmlRpcClientResponseProcessor(TimeZone tz)
Creates a new instance.

Method Detail

canReUse

protected boolean canReUse()
Called by the worker management framework to see if this worker can be re-used. Must attempt to clean up any state, and return true if it can be re-used.

Returns: boolean true if this worker has been cleaned up and may be re-used.

decodeException

protected XmlRpcException decodeException(Object result)
Decode an exception from the result returned from the remote server. This method both returns and throws an XmlRpcException. If it returns an XmlRpcException then that is the exception thrown on the remote side. If it throws an exception then an exception occured locally when decoding the response

Parameters: result The response from the remote XML-RPC server.

Returns: A XmlRpcException describing the error which occurred. XmlRpcException the processed response from the server.

Throws: XmlRpcClientException if the result could not be processed.

decodeResponse

public Object decodeResponse(InputStream is)
Decode an XML-RPC response from the specified InputStream.

Parameters: is The stream from which to read the response.

Returns: The response, which will be a XmlRpcException if an error occured.

Throws: XmlRpcClientException

objectParsed

protected void objectParsed(Object what)

startElement

public void startElement(String name, AttributeList atts)
Overrides method in XmlRpc to handle fault repsonses.
Copyright B) 1999-2002 Apache Software Foundation. All Rights Reserved.