/** Performs the given request. * @param pRequest The request being executed. * @return The result object. * @throws XmlRpcException The request failed. */ public Object execute(XmlRpcRequest pRequest) throws XmlRpcException { final XmlRpcWorkerFactory factory = getWorkerFactory(); final XmlRpcWorker worker = factory.getWorker(); try { return worker.execute(pRequest); } finally { factory.releaseWorker(worker); } } }
public XmlRpcController getController() { return factory.getController(); }
/** Performs a request with the clients default configuration. * @param pRequest The request being performed. * @return The result object. * @throws XmlRpcException Performing the request failed. */ public Object execute(XmlRpcRequest pRequest) throws XmlRpcException { return getWorkerFactory().getWorker().execute(pRequest); }
/** Performs a synchronous request. * @param pRequest The request being performed. * @return The requests result. * @throws XmlRpcException Performing the request failed. */ public Object execute(XmlRpcRequest pRequest) throws XmlRpcException { try { XmlRpcClient client = (XmlRpcClient) getController(); return client.getTransportFactory().getTransport().sendRequest(pRequest); } finally { factory.releaseWorker(this); } }
/** Returns a worker for synchronous processing. * @return An instance of {@link XmlRpcWorker}, which is ready * for use. * @throws XmlRpcLoadException The clients maximum number of concurrent * threads is exceeded. */ public synchronized XmlRpcWorker getWorker() throws XmlRpcLoadException { int max = controller.getMaxThreads(); if (max > 0 && numThreads == max) { throw new XmlRpcLoadException("Maximum number of concurrent requests exceeded: " + max); } if (max == 0) { return singleton; } ++numThreads; if (pool.size() == 0) { return newWorker(); } else { return (XmlRpcWorker) pool.remove(pool.size() - 1); } }
/** Performs a request with the clients default configuration. * @param pRequest The request being performed. * @param pCallback The callback being notified when the request is finished. * @throws XmlRpcException Performing the request failed. */ public void executeAsync(XmlRpcRequest pRequest, AsyncCallback pCallback) throws XmlRpcException { XmlRpcClientWorker w = (XmlRpcClientWorker) getWorkerFactory().getWorker(); w.execute(pRequest, pCallback); }
public void run(){ Object result = null; Throwable th = null; try { XmlRpcClient client = (XmlRpcClient) getController(); result = client.getTransportFactory().getTransport().sendRequest(pRequest); } catch (Throwable t) { th = t; } factory.releaseWorker(XmlRpcClientWorker.this); if (th == null) { pCallback.handleResult(pRequest, result); } else { pCallback.handleError(pRequest, th); } } };
/** Returns a worker for synchronous processing. * @return An instance of {@link XmlRpcWorker}, which is ready * for use. * @throws XmlRpcLoadException The clients maximum number of concurrent * threads is exceeded. */ public synchronized XmlRpcWorker getWorker() throws XmlRpcLoadException { int max = controller.getMaxThreads(); if (max > 0 && numThreads == max) { throw new XmlRpcLoadException("Maximum number of concurrent requests exceeded: " + max); } if (max == 0) { return singleton; } ++numThreads; if (pool.size() == 0) { return newWorker(); } else { return (XmlRpcWorker) pool.remove(pool.size() - 1); } }
/** Performs the given request. * @param pRequest The request being executed. * @return The result object. * @throws XmlRpcException The request failed. */ public Object execute(XmlRpcRequest pRequest) throws XmlRpcException { final XmlRpcWorkerFactory factory = getWorkerFactory(); final XmlRpcWorker worker = factory.getWorker(); try { return worker.execute(pRequest); } finally { factory.releaseWorker(worker); } } }
/** Performs a request with the clients default configuration. * @param pRequest The request being performed. * @param pCallback The callback being notified when the request is finished. * @throws XmlRpcException Performing the request failed. */ public void executeAsync(XmlRpcRequest pRequest, AsyncCallback pCallback) throws XmlRpcException { XmlRpcClientWorker w = (XmlRpcClientWorker) getWorkerFactory().getWorker(); w.execute(pRequest, pCallback); }
/** Returns a worker for synchronous processing. * @return An instance of {@link XmlRpcWorker}, which is ready * for use. * @throws XmlRpcLoadException The clients maximum number of concurrent * threads is exceeded. */ public synchronized XmlRpcWorker getWorker() throws XmlRpcLoadException { int max = controller.getMaxThreads(); if (max > 0 && numThreads == max) { throw new XmlRpcLoadException("Maximum number of concurrent requests exceeded: " + max); } if (max == 0) { return singleton; } ++numThreads; if (pool.size() == 0) { return newWorker(); } else { return (XmlRpcWorker) pool.remove(pool.size() - 1); } }
/** Performs the given request. * @param pRequest The request being executed. * @return The result object. * @throws XmlRpcException The request failed. */ public Object execute(XmlRpcRequest pRequest) throws XmlRpcException { final XmlRpcWorkerFactory factory = getWorkerFactory(); final XmlRpcWorker worker = factory.getWorker(); try { return worker.execute(pRequest); } finally { factory.releaseWorker(worker); } } }
/** Performs a request with the clients default configuration. * @param pRequest The request being performed. * @return The result object. * @throws XmlRpcException Performing the request failed. */ public Object execute(XmlRpcRequest pRequest) throws XmlRpcException { return getWorkerFactory().getWorker().execute(pRequest); }
/** Performs a request with the clients default configuration. * @param pRequest The request being performed. * @return The result object. * @throws XmlRpcException Performing the request failed. */ public Object execute(XmlRpcRequest pRequest) throws XmlRpcException { return getWorkerFactory().getWorker().execute(pRequest); }
/** Performs a request with the clients default configuration. * @param pRequest The request being performed. * @param pCallback The callback being notified when the request is finished. * @throws XmlRpcException Performing the request failed. */ public void executeAsync(XmlRpcRequest pRequest, AsyncCallback pCallback) throws XmlRpcException { XmlRpcClientWorker w = (XmlRpcClientWorker) getWorkerFactory().getWorker(); w.execute(pRequest, pCallback); }
/** Performs a request with the clients default configuration. * @param pRequest The request being performed. * @return The result object. * @throws XmlRpcException Performing the request failed. */ public Object execute(XmlRpcRequest pRequest) throws XmlRpcException { return getWorkerFactory().getWorker().execute(pRequest); }