Package org.apache.xmlrpc.client

Examples of org.apache.xmlrpc.client.TimingOutCallback$TimeoutException


    /* default timeout is 10 mins */
    return callTimeoutInSec(method, params, 600, debug);
  }
 
  public Object callTimeoutInSec(String method, Object[] params, int timeout, boolean debug) throws XmlRpcException {
    TimingOutCallback callback = new TimingOutCallback(timeout * 1000);
    Object[] mParams = new Object[params.length + 1];
    mParams[0] = method;
    for (int i=0; i<params.length; i++) {
      mParams[i+1] = params[i];
    }

    if (debug) {
      /*
       * some parameters including user password should not be printed in log
       */
      s_logger.debug("Call Ovm agent: " + Coder.toJson(mParams));
    }
   
    long startTime = System.currentTimeMillis();
    _client.executeAsync("OvmDispatch", mParams, callback);
    try {
      return callback.waitForResponse();
    } catch (TimingOutCallback.TimeoutException to) {
      throw to;
    } catch (Throwable e) {
      throw new XmlRpcException(-2, e.getMessage());
    } finally {
View Full Code Here



    private void testXMLRPC112(ClientProvider pProvider) throws Exception {
        XmlRpcClient client = pProvider.getClient();
        client.setConfig(getConfig(pProvider));
        TimingOutCallback toc = new TimingOutCallback(5000);
        final String methodName = XMLRPC89Handler.class.getName() + ".reverse";
        client.executeAsync(methodName, new Object[]{new Object[]{"1", "2", "3"}}, toc);
        Object o;
        try {
            o = toc.waitForResponse();
        } catch (Exception e) {
            throw e;
        } catch (Throwable t) {
            throw new UndeclaredThrowableException(t);
        }
View Full Code Here


    private void testXMLRPC112(ClientProvider pProvider) throws Exception {
        XmlRpcClient client = pProvider.getClient();
        client.setConfig(getConfig(pProvider));
        TimingOutCallback toc = new TimingOutCallback(5000);
        final String methodName = XMLRPC89Handler.class.getName() + ".reverse";
        client.executeAsync(methodName, new Object[]{new Object[]{"1", "2", "3"}}, toc);
        Object o;
        try {
            o = toc.waitForResponse();
        } catch (Exception e) {
            throw e;
        } catch (Throwable t) {
            throw new UndeclaredThrowableException(t);
        }
View Full Code Here

        /* default timeout is 10 mins */
        return callTimeoutInSec(method, params, 600, debug);
    }

    public Object callTimeoutInSec(String method, Object[] params, int timeout, boolean debug) throws XmlRpcException {
        TimingOutCallback callback = new TimingOutCallback(timeout * 1000);
        Object[] mParams = new Object[params.length + 1];
        mParams[0] = method;
        for (int i = 0; i < params.length; i++) {
            mParams[i + 1] = params[i];
        }

        if (debug) {
            /*
             * some parameters including user password should not be printed in log
             */
            s_logger.debug("Call Ovm agent: " + Coder.toJson(mParams));
        }

        long startTime = System.currentTimeMillis();
        _client.executeAsync("OvmDispatch", mParams, callback);
        try {
            return callback.waitForResponse();
        } catch (TimingOutCallback.TimeoutException to) {
            throw to;
        } catch (Throwable e) {
            throw new XmlRpcException(-2, e.getMessage());
        } finally {
View Full Code Here

TOP

Related Classes of org.apache.xmlrpc.client.TimingOutCallback$TimeoutException

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.