Package org.apache.xmlrpc.client
Class XmlRpcClientWorker
- java.lang.Object
-
- org.apache.xmlrpc.client.XmlRpcClientWorker
-
- All Implemented Interfaces:
XmlRpcWorker
public class XmlRpcClientWorker extends java.lang.Object implements XmlRpcWorker
Object, which performs a request on the clients behalf. The client maintains a pool of workers. The main purpose of the pool is limitation of the maximum number of concurrent requests.- Since:
- 3.0
-
-
Field Summary
Fields Modifier and Type Field Description private XmlRpcClientWorkerFactory
factory
-
Constructor Summary
Constructors Constructor Description XmlRpcClientWorker(XmlRpcClientWorkerFactory pFactory)
Creates a new instance.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.Object
execute(XmlRpcRequest pRequest)
Performs a synchronous request.void
execute(XmlRpcRequest pRequest, AsyncCallback pCallback)
Performs an synchronous request.XmlRpcController
getController()
Returns the workers controller.protected java.lang.Thread
newThread(java.lang.Runnable pRunnable)
-
-
-
Field Detail
-
factory
private final XmlRpcClientWorkerFactory factory
-
-
Constructor Detail
-
XmlRpcClientWorker
public XmlRpcClientWorker(XmlRpcClientWorkerFactory pFactory)
Creates a new instance.- Parameters:
pFactory
- The factory, which is being notified, if the worker's ready.
-
-
Method Detail
-
getController
public XmlRpcController getController()
Description copied from interface:XmlRpcWorker
Returns the workers controller.- Specified by:
getController
in interfaceXmlRpcWorker
- Returns:
- The controller, an instance of
XmlRpcClient
, orXmlRpcServer
.
-
execute
public java.lang.Object execute(XmlRpcRequest pRequest) throws XmlRpcException
Performs a synchronous request.- Specified by:
execute
in interfaceXmlRpcWorker
- Parameters:
pRequest
- The request being performed.- Returns:
- The requests result.
- Throws:
XmlRpcException
- Performing the request failed.
-
newThread
protected java.lang.Thread newThread(java.lang.Runnable pRunnable)
-
execute
public void execute(XmlRpcRequest pRequest, AsyncCallback pCallback)
Performs an synchronous request.- Parameters:
pRequest
- The request being performed.pCallback
- The callback being invoked, when the request is finished.
-
-