Package org.apache.xmlrpc.common
Class XmlRpcWorkerFactory
java.lang.Object
org.apache.xmlrpc.common.XmlRpcWorkerFactory
- Direct Known Subclasses:
XmlRpcClientWorkerFactory,XmlRpcServerWorkerFactory
A factory for
XmlRpcWorker instances.-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final XmlRpcControllerprivate intprivate final Listprivate final XmlRpcWorker -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionReturns the factory controller.intReturns the number of currently running requests.Returns a worker for synchronous processing.protected abstract XmlRpcWorkerCreates a new worker instance.voidreleaseWorker(XmlRpcWorker pWorker) Called, when the worker did its job.
-
Field Details
-
singleton
-
controller
-
pool
-
numThreads
private int numThreads
-
-
Constructor Details
-
XmlRpcWorkerFactory
Creates a new instance.- Parameters:
pController- The client controlling the factory.
-
-
Method Details
-
newWorker
Creates a new worker instance.- Returns:
- New instance of
XmlRpcWorker.
-
getController
Returns the factory controller.- Returns:
- The controller, an instance of
XmlRpcClient, orXmlRpcServer.
-
getWorker
Returns a worker for synchronous processing.- Returns:
- An instance of
XmlRpcWorker, which is ready for use. - Throws:
XmlRpcLoadException- The clients maximum number of concurrent threads is exceeded.
-
releaseWorker
Called, when the worker did its job. Frees resources and decrements the number of concurrent requests.- Parameters:
pWorker- The worker being released.
-
getCurrentRequests
public int getCurrentRequests()Returns the number of currently running requests.- Returns:
- Current number of concurrent requests.
-