|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.flat502.rox.processing.HttpRpcProcessor com.flat502.rox.client.HttpRpcClient com.flat502.rox.client.XmlRpcClient
public class XmlRpcClient
This is the client-side XML-RPC interface.
This is a specialization of the
HttpRpcClient
.
Typical synchronous usage of this class is illustrated in the following sample:
XmlRpcClient client = new XmlRpcClient(new URL("http://localhost:8080/")); Object rsp = client.execute("math.increment", new Object[] { new Integer(42) });
Typical asynchronous usage of this class is illustrated in the following sample:
public class OnceAsyncClient implements ResponseHandler { public static boolean done = false; public void handleResponse(XMLRPCMethodCall call, XMLRPCMethodResponse response) { System.out.println(response.getReturnValue()); done = true; } public void handleException(XMLRPCMethodCall call, Exception e) { e.printStackTrace(); done = true; } public static void main(String[] args) { try { XMLRPCClient client = new XMLRPCClient(new URL("http://localhost:8080/")); client.execute("math.increment", new Object[] { new Integer(42) }, new OnceAsyncClient()); while(!done) { Thread.yield(); } } catch (Exception e) { e.printStackTrace(); } } }
Field Summary |
---|
Fields inherited from class com.flat502.rox.processing.HttpRpcProcessor |
---|
ALL_CIPHER_SUITES, ANON_CIPHER_SUITES |
Constructor Summary | |
---|---|
XmlRpcClient(java.net.URL url)
|
|
XmlRpcClient(java.net.URL url,
ClientResourcePool workerPool)
|
|
XmlRpcClient(java.net.URL url,
ClientResourcePool workerPool,
SSLConfiguration sslCfg)
|
|
XmlRpcClient(java.net.URL url,
SSLConfiguration sslCfg)
|
Method Summary | |
---|---|
protected MethodResponseUnmarshaller |
getMethodResponseUnmarshaller()
Retrieves an MethodResponseUnmarshaller instance
for unmarshalling incoming RpcResponse s. |
protected RpcCall |
newRpcCall(java.lang.String name,
java.lang.Object[] params)
|
void |
setCompactXml(boolean compact)
Configure the compactness of the marshalled form of this instance. |
void |
setFieldNameCodec(FieldNameCodec codec)
|
void |
setUnmarshaller(MethodResponseUnmarshaller unmarshaller)
Configure the MethodResponseUnmarshaller instance to
use when unmarshalling incoming XML-RPC responses. |
Methods inherited from class com.flat502.rox.processing.HttpRpcProcessor |
---|
addWorker, addWorkers, deregisterSocket, getQueue, getSocketSelector, getSSLConfiguration, getSSLSession, getTimer, getWorkerCount, initSelector, isSharedWorkerPool, isStarted, newSSLSession, queueCancellation, queueRead, queueRegistration, queueWrite, queueWrite, read, registerProfiler, registerSocket, registerSSLSessionPolicy, removeWorker, setCipherSuitePattern, setSSLHandshakeTimeout, shouldUseHTTPS, start, stop, write |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public XmlRpcClient(java.net.URL url) throws java.io.IOException
java.io.IOException
public XmlRpcClient(java.net.URL url, SSLConfiguration sslCfg) throws java.io.IOException
java.io.IOException
public XmlRpcClient(java.net.URL url, ClientResourcePool workerPool) throws java.io.IOException
java.io.IOException
public XmlRpcClient(java.net.URL url, ClientResourcePool workerPool, SSLConfiguration sslCfg) throws java.io.IOException
java.io.IOException
Method Detail |
---|
protected RpcCall newRpcCall(java.lang.String name, java.lang.Object[] params)
newRpcCall
in class HttpRpcClient
public void setCompactXml(boolean compact)
The marshalled form of instances is compact by default.
compact
- A flag indicating whether to produce compact XML (true
)
or more readable XML (false
).public void setUnmarshaller(MethodResponseUnmarshaller unmarshaller)
MethodResponseUnmarshaller
instance to
use when unmarshalling incoming XML-RPC responses.
unmarshaller
- The new unmarshaller instance to use.TODO: Link to Sax unmarshaller
public void setFieldNameCodec(FieldNameCodec codec)
protected MethodResponseUnmarshaller getMethodResponseUnmarshaller()
HttpRpcClient
MethodResponseUnmarshaller
instance
for unmarshalling incoming RpcResponse
s.
Implementations may return the same unmarshaller instance for each call to this method as long as that unmarshaller is thread-safe.
getMethodResponseUnmarshaller
in class HttpRpcClient
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |