|
||||||||||
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.server.HttpRpcServer com.flat502.rox.server.XmlRpcServer
public class XmlRpcServer
This is the server-side XML-RPC interface.
This is a specialization of the
HttpRpcServer
.
An instance of this class will not actually bind to any
addresses until Thread.start()
is invoked.
Typical usage of this class is illustrated in the following sample:
public class Handler implements SyncRequestHandler { public RpcResponse handleRequest(RpcCall call) { // Handle the call and return a response } } ... XmlRpcServer server = new XmlRpcServer(host, port); server.registerHandler(null, "^math\\.", new Handler()); server.start();
In addition, this class supports
asynchronous method handling
and dynamic method discovery
.
You're encouraged to read through the examples section.
Field Summary |
---|
Fields inherited from class com.flat502.rox.processing.HttpRpcProcessor |
---|
ALL_CIPHER_SUITES, ANON_CIPHER_SUITES |
Constructor Summary | |
---|---|
XmlRpcServer(java.net.InetAddress hostAddress,
int port)
Initialize an instance listening for connections on a specified local address. |
|
XmlRpcServer(java.net.InetAddress hostAddress,
int port,
boolean useHttps)
Initialize an instance listening for connections on a specified local address. |
|
XmlRpcServer(java.net.InetAddress hostAddress,
int port,
boolean useHttps,
AcceptPolicy acceptPolicy,
ServerResourcePool workerPool)
Initialize an instance listening for connections on a specified local address. |
|
XmlRpcServer(java.net.InetAddress hostAddress,
int port,
boolean useHttps,
AcceptPolicy acceptPolicy,
ServerResourcePool workerPool,
SSLConfiguration sslCfg)
|
|
XmlRpcServer(java.net.InetAddress hostAddress,
int port,
SSLConfiguration sslCfg)
|
|
XmlRpcServer(int port)
Initialize an instance listening for connections on all local addresses. |
Method Summary | |
---|---|
RequestHandler |
registerProxyingHandler(java.lang.String uri,
java.lang.String method,
java.lang.Object target)
Register an XML-RPC aware ProxyingRequestHandler proxying
the specified target object. |
void |
setUnmarshaller(MethodCallUnmarshaller unmarshaller)
Configure the MethodResponseUnmarshaller instance to
use when unmarshalling incoming XML-RPC method calls. |
Methods inherited from class com.flat502.rox.processing.HttpRpcProcessor |
---|
addWorker, addWorkers, deregisterChannel, getQueue, getSocketSelector, getSSLConfiguration, getSSLSession, getTimer, getWorkerCount, initialize, isSharedWorkerPool, isStarted, newSSLSession, queueCancellation, queueRead, queueRegistration, queueWrite, queueWrite, registerChannel, registerProfiler, registerSocket, registerSSLSessionPolicy, removeWorker, setCipherSuitePattern, setSSLHandshakeTimeout, shouldUseHTTPS, start, stop |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public XmlRpcServer(int port) throws java.io.IOException
HTTPS (SSL) and logging are disabled and no
accept policy
is installed.
port
- The port to listen on.
java.io.IOException
- if an error occurs initializing the underlying
server socket.public XmlRpcServer(java.net.InetAddress hostAddress, int port) throws java.io.IOException
HTTPS (SSL) is disabled and no
accept policy
is installed.
hostAddress
- The address to listen on. If this is null
this instance will listen on all local addresses.port
- The port to listen on.
java.io.IOException
- if an error occurs initializing the underlying
server socket.public XmlRpcServer(java.net.InetAddress hostAddress, int port, SSLConfiguration sslCfg) throws java.io.IOException
java.io.IOException
public XmlRpcServer(java.net.InetAddress hostAddress, int port, boolean useHttps) throws java.io.IOException
No accept policy
is installed.
hostAddress
- The address to listen on. If this is null
this instance will listen on all local addresses.port
- The port to listen on.
java.io.IOException
- if an error occurs initializing the underlying
server socket.public XmlRpcServer(java.net.InetAddress hostAddress, int port, boolean useHttps, AcceptPolicy acceptPolicy, ServerResourcePool workerPool) throws java.io.IOException
hostAddress
- The address to listen on. If this is null
this instance will listen on all local addresses.port
- The port to listen on.useHttps
- Indicates whether or not HTTPS (SSL) should be enabled.acceptPolicy
- The AcceptPolicy
to apply. May be null
.workerPool
- A shared ServerResourcePool
instance from which
resources (like timers and threads) should be drawn.
java.io.IOException
- if an error occurs initializing the underlying
server socket.public XmlRpcServer(java.net.InetAddress hostAddress, int port, boolean useHttps, AcceptPolicy acceptPolicy, ServerResourcePool workerPool, SSLConfiguration sslCfg) throws java.io.IOException
java.io.IOException
Method Detail |
---|
public RequestHandler registerProxyingHandler(java.lang.String uri, java.lang.String method, java.lang.Object target)
ProxyingRequestHandler
proxying
the specified target object.
A SynchronousRequestHandler
is registered for the specified
URI. Method dispatch and request unmarshalling is described in the
documentation for RpcMethodProxy
.
uri
- The URI for which this handler is responsible. null
indicates all URIs.method
- A regular expression (see Pattern
) to
match method names on. Matching is performed as for the
Matcher.find()
method.target
- The object to delegate XML-RPC requests to.
RequestHandler
that was registered.public void setUnmarshaller(MethodCallUnmarshaller unmarshaller)
MethodResponseUnmarshaller
instance to
use when unmarshalling incoming XML-RPC method calls.
unmarshaller
- The new unmarshaller instance to use.DomMethodCallUnmarshaller
,
SaxMethodCallUnmarshaller
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |