Classes | Public Member Functions | Private Attributes
org.apache.xmlrpc.client.TimingOutCallback Class Reference
Inheritance diagram for org.apache.xmlrpc.client.TimingOutCallback:
Inheritance graph
[legend]

List of all members.

Classes

class  TimeoutException

Public Member Functions

synchronized void handleError (XmlRpcRequest pRequest, Throwable pError)
synchronized void handleResult (XmlRpcRequest pRequest, Object pResult)
 TimingOutCallback (long pTimeout)
synchronized Object waitForResponse () throws Throwable

Private Attributes

Throwable error
boolean responseSeen
Object result
final long timeout

Detailed Description

A callback object that can wait up to a specified amount of time for the XML-RPC response. Suggested use is as follows:

   // Wait for 10 seconds.
   TimingOutCallback callback = new TimingOutCallback(10 * 1000);
   XmlRpcClient client = new XmlRpcClient(url);
   client.executeAsync(methodName, aVector, callback);
   try {
       return callback.waitForResponse();
   } catch (TimeoutException e) {
       System.out.println("No response from server.");
   } catch (Exception e) {
       System.out.println("Server returned an error message.");
   }
 

Definition at line 43 of file TimingOutCallback.java.


Constructor & Destructor Documentation

Waits the specified number of milliseconds for a response.

Definition at line 64 of file TimingOutCallback.java.


Member Function Documentation

synchronized void org.apache.xmlrpc.client.TimingOutCallback.handleError ( XmlRpcRequest  pRequest,
Throwable  pError 
) [inline]

Something went wrong, handle error.

Parameters:
pRequestThe request being performed.
pErrorThe error being thrown.

Implements org.apache.xmlrpc.client.AsyncCallback.

Definition at line 86 of file TimingOutCallback.java.

synchronized void org.apache.xmlrpc.client.TimingOutCallback.handleResult ( XmlRpcRequest  pRequest,
Object  pResult 
) [inline]

Call went ok, handle result.

Parameters:
pRequestThe request being performed.
pResultThe result object, which was returned by the server.

Implements org.apache.xmlrpc.client.AsyncCallback.

Definition at line 92 of file TimingOutCallback.java.

synchronized Object org.apache.xmlrpc.client.TimingOutCallback.waitForResponse ( ) throws Throwable [inline]

Called to wait for the response.

Exceptions:
InterruptedExceptionThe thread was interrupted.
TimeoutExceptionNo response was received after waiting the specified time.
ThrowableAn error was returned by the server.

Definition at line 73 of file TimingOutCallback.java.


Member Data Documentation

Definition at line 59 of file TimingOutCallback.java.

Definition at line 60 of file TimingOutCallback.java.

Definition at line 58 of file TimingOutCallback.java.

Definition at line 57 of file TimingOutCallback.java.


The documentation for this class was generated from the following file:


rosjava_core
Author(s):
autogenerated on Wed Aug 26 2015 16:06:50