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"); } }
xmlClient.executeAsync(req, callback); return callback.waitForResponse(); } catch (TimingOutCallback.TimeoutException e) {
/** Performs an asynchronous request with the clients default configuration. * @param pMethodName The method being performed. * @param pParams The parameters. * @param pCallback The callback being notified when the request is finished. * @throws XmlRpcException Performing the request failed. */ public void executeAsync(String pMethodName, Object[] pParams, AsyncCallback pCallback) throws XmlRpcException { executeAsync(getClientConfig(), pMethodName, pParams, pCallback); }
/** Performs an asynchronous request with the given configuration. * @param pConfig The request configuration. * @param pMethodName The method being performed. * @param pParams The parameters. * @param pCallback The callback being notified when the request is finished. * @throws XmlRpcException Performing the request failed. */ public void executeAsync(XmlRpcClientConfig pConfig, String pMethodName, List pParams, AsyncCallback pCallback) throws XmlRpcException { executeAsync(new XmlRpcClientRequestImpl(pConfig, pMethodName, pParams), pCallback); }
/** Performs an asynchronous request with the clients default configuration. * @param pMethodName The method being performed. * @param pParams The parameters. * @param pCallback The callback being notified when the request is finished. * @throws XmlRpcException Performing the request failed. */ public void executeAsync(String pMethodName, List pParams, AsyncCallback pCallback) throws XmlRpcException { executeAsync(getClientConfig(), pMethodName, pParams, pCallback); }
/** Performs an asynchronous request with the clients default configuration. * @param pMethodName The method being performed. * @param pParams The parameters. * @param pCallback The callback being notified when the request is finished. * @throws XmlRpcException Performing the request failed. */ public void executeAsync(String pMethodName, Object[] pParams, AsyncCallback pCallback) throws XmlRpcException { executeAsync(getClientConfig(), pMethodName, pParams, pCallback); }
/** Performs an asynchronous request with the given configuration. * @param pConfig The request configuration. * @param pMethodName The method being performed. * @param pParams The parameters. * @param pCallback The callback being notified when the request is finished. * @throws XmlRpcException Performing the request failed. */ public void executeAsync(XmlRpcClientConfig pConfig, String pMethodName, List pParams, AsyncCallback pCallback) throws XmlRpcException { executeAsync(new XmlRpcClientRequestImpl(pConfig, pMethodName, pParams), pCallback); }
/** Performs an asynchronous request with the clients default configuration. * @param pMethodName The method being performed. * @param pParams The parameters. * @param pCallback The callback being notified when the request is finished. * @throws XmlRpcException Performing the request failed. */ public void executeAsync(String pMethodName, List pParams, AsyncCallback pCallback) throws XmlRpcException { executeAsync(getClientConfig(), pMethodName, pParams, pCallback); }
/** Performs an asynchronous request with the clients default configuration. * @param pMethodName The method being performed. * @param pParams The parameters. * @param pCallback The callback being notified when the request is finished. * @throws XmlRpcException Performing the request failed. */ public void executeAsync(String pMethodName, List pParams, AsyncCallback pCallback) throws XmlRpcException { executeAsync(getClientConfig(), pMethodName, pParams, pCallback); }
/** Performs an asynchronous request with the given configuration. * @param pConfig The request configuration. * @param pMethodName The method being performed. * @param pParams The parameters. * @param pCallback The callback being notified when the request is finished. * @throws XmlRpcException Performing the request failed. */ public void executeAsync(XmlRpcClientConfig pConfig, String pMethodName, List pParams, AsyncCallback pCallback) throws XmlRpcException { executeAsync(new XmlRpcClientRequestImpl(pConfig, pMethodName, pParams), pCallback); }
/** Performs an asynchronous request with the clients default configuration. * @param pMethodName The method being performed. * @param pParams The parameters. * @param pCallback The callback being notified when the request is finished. * @throws XmlRpcException Performing the request failed. */ public void executeAsync(String pMethodName, Object[] pParams, AsyncCallback pCallback) throws XmlRpcException { executeAsync(getClientConfig(), pMethodName, pParams, pCallback); }
/** Performs an asynchronous request with the given configuration. * @param pConfig The request configuration. * @param pMethodName The method being performed. * @param pParams The parameters. * @param pCallback The callback being notified when the request is finished. * @throws XmlRpcException Performing the request failed. */ public void executeAsync(XmlRpcClientConfig pConfig, String pMethodName, Object[] pParams, AsyncCallback pCallback) throws XmlRpcException { executeAsync(new XmlRpcClientRequestImpl(pConfig, pMethodName, pParams), pCallback); }
/** Performs an asynchronous request with the given configuration. * @param pConfig The request configuration. * @param pMethodName The method being performed. * @param pParams The parameters. * @param pCallback The callback being notified when the request is finished. * @throws XmlRpcException Performing the request failed. */ public void executeAsync(XmlRpcClientConfig pConfig, String pMethodName, Object[] pParams, AsyncCallback pCallback) throws XmlRpcException { executeAsync(new XmlRpcClientRequestImpl(pConfig, pMethodName, pParams), pCallback); }
/** Performs an asynchronous request with the given configuration. * @param pConfig The request configuration. * @param pMethodName The method being performed. * @param pParams The parameters. * @param pCallback The callback being notified when the request is finished. * @throws XmlRpcException Performing the request failed. */ public void executeAsync(XmlRpcClientConfig pConfig, String pMethodName, Object[] pParams, AsyncCallback pCallback) throws XmlRpcException { executeAsync(new XmlRpcClientRequestImpl(pConfig, pMethodName, pParams), pCallback); }
try { TimingOutCallback callback = new TimingOutCallback(timeout); client.executeAsync(methodName, pArgs, callback); result = callback.waitForResponse(); } catch (TimingOutCallback.TimeoutException e) {