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 |
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.
org.apache.xmlrpc.client.TimingOutCallback.TimingOutCallback | ( | long | pTimeout | ) | [inline] |
Waits the specified number of milliseconds for a response.
Definition at line 64 of file TimingOutCallback.java.
synchronized void org.apache.xmlrpc.client.TimingOutCallback.handleError | ( | XmlRpcRequest | pRequest, |
Throwable | pError | ||
) | [inline] |
Something went wrong, handle error.
pRequest | The request being performed. |
pError | The 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.
pRequest | The request being performed. |
pResult | The 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.
InterruptedException | The thread was interrupted. |
TimeoutException | No response was received after waiting the specified time. |
Throwable | An error was returned by the server. |
Definition at line 73 of file TimingOutCallback.java.
Throwable org.apache.xmlrpc.client.TimingOutCallback.error [private] |
Definition at line 59 of file TimingOutCallback.java.
boolean org.apache.xmlrpc.client.TimingOutCallback.responseSeen [private] |
Definition at line 60 of file TimingOutCallback.java.
Object org.apache.xmlrpc.client.TimingOutCallback.result [private] |
Definition at line 58 of file TimingOutCallback.java.
final long org.apache.xmlrpc.client.TimingOutCallback.timeout [private] |
Definition at line 57 of file TimingOutCallback.java.