Class TimingOutCallback

java.lang.Object
org.apache.xmlrpc.client.TimingOutCallback
All Implemented Interfaces:
AsyncCallback

public class TimingOutCallback extends Object implements AsyncCallback

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.");
   }
 
  • Field Details

    • timeout

      private final long timeout
    • result

      private Object result
    • error

      private Throwable error
    • responseSeen

      private boolean responseSeen
  • Constructor Details

    • TimingOutCallback

      public TimingOutCallback(long pTimeout)
      Waits the specified number of milliseconds for a response.
  • Method Details