/** 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); } }
/** 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); } }
/** 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); } }