class ClientXmlRpcHandler extends ActorHandler
CallableClients to provide client callbacks
from the hub.| Modifier and Type | Class and Description |
|---|---|
private static class |
ClientXmlRpcHandler.ClientActorImpl
Implementation of the
ClientActor interface which does the
work for this class. |
private static class |
ClientXmlRpcHandler.Entry
Utility class to aggregate information about a client.
|
| Modifier and Type | Field and Description |
|---|---|
private ClientXmlRpcHandler.ClientActorImpl |
clientActor_ |
private static java.util.logging.Logger |
logger_ |
| Constructor and Description |
|---|
ClientXmlRpcHandler()
Constructor.
|
| Modifier and Type | Method and Description |
|---|---|
void |
addClient(HubConnection connection,
CallableClient callable)
Adds a CallableClient object to this server.
|
int |
getClientCount()
Returns the number of clients currently owned by this handler.
|
protected java.lang.Object |
invokeMethod(java.lang.reflect.Method method,
java.lang.Object obj,
java.lang.Object[] args)
Invokes a method reflectively on an object.
|
void |
removeClient(HubConnection connection)
Removes a CallableClient object from this server.
|
canHandleCall, getActor, handleCallprivate final ClientXmlRpcHandler.ClientActorImpl clientActor_
private static final java.util.logging.Logger logger_
public void addClient(HubConnection connection, CallableClient callable)
connection - hub connection for the registered client on behalf
of which the client will operatecallable - callable client objectpublic void removeClient(HubConnection connection)
privateKey - hub connection for which this client was addedpublic int getClientCount()
protected java.lang.Object invokeMethod(java.lang.reflect.Method method,
java.lang.Object obj,
java.lang.Object[] args)
throws java.lang.IllegalAccessException,
java.lang.reflect.InvocationTargetException
ActorHandlerreturn method.invoke(obj,params).
If the implementation is effectively prescribed, why is this
abstract method here? It's tricky.
The reason is so that reflective method invocation from this class
is done by code within the actor implementation class itself
rather than by code in the superclass, ActorHandler.
That in turn means that the actorType class specified
in the constructor does not need to be visible from
ActorHandler's package, only from the package where
the implementation class lives.
invokeMethod in class ActorHandlermethod - method to invokeobj - object to invoke the method onargs - arguments for the method calljava.lang.IllegalAccessExceptionjava.lang.reflect.InvocationTargetExceptionMethod.invoke(java.lang.Object, java.lang.Object...)