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 { long endTime = System.currentTimeMillis(); long during = (endTime - startTime) / 1000; // in secs s_logger.debug("Ovm call " + method + " finished in " + String.valueOf(during) + " secs"); } }
public Object callTimeoutInSec(String method, List<?> params, int timeout, boolean debug) throws XmlRpcException { TimingOutCallback callback = new TimingOutCallback(timeout * 1000); if (debug) { LOGGER.debug("Call Ovm3 agent " + hostName + "(" + hostIp +"): " + method
TimingOutCallback callback = new TimingOutCallback(timeout); client.executeAsync(methodName, pArgs, callback); result = callback.waitForResponse();