Package org.astrogrid.samp.xmlrpc
Class HubXmlRpcHandler
- java.lang.Object
-
- org.astrogrid.samp.xmlrpc.ActorHandler
-
- org.astrogrid.samp.xmlrpc.HubXmlRpcHandler
-
- All Implemented Interfaces:
SampXmlRpcHandler
class HubXmlRpcHandler extends ActorHandler
SampXmlRpcHandler implementation which passes Standard Profile-type XML-RPC calls to a hub connection factory to provide a Standard Profile hub server.- Since:
- 15 Jul 2008
- Author:
- Mark Taylor
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description private static class
HubXmlRpcHandler.HubActorImpl
Implementation of theHubActor
interface which does the work for this class.
-
Constructor Summary
Constructors Constructor Description HubXmlRpcHandler(SampXmlRpcClientFactory xClientFactory, ClientProfile profile, java.lang.String secret, KeyGenerator keyGen)
Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description 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.-
Methods inherited from class org.astrogrid.samp.xmlrpc.ActorHandler
canHandleCall, getActor, handleCall
-
-
-
-
Constructor Detail
-
HubXmlRpcHandler
public HubXmlRpcHandler(SampXmlRpcClientFactory xClientFactory, ClientProfile profile, java.lang.String secret, KeyGenerator keyGen)
Constructor.- Parameters:
xClientFactory
- XML-RPC client factory implementationprofile
- hub connection factorysecret
- password required for client registration
-
-
Method Detail
-
invokeMethod
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
Description copied from class:ActorHandler
Invokes a method reflectively on an object. This method should be implemented in the obvious way, that isreturn 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 theactorType
class specified in the constructor does not need to be visible fromActorHandler
's package, only from the package where the implementation class lives.- Specified by:
invokeMethod
in classActorHandler
- Parameters:
method
- method to invokeobj
- object to invoke the method onargs
- arguments for the method call- Throws:
java.lang.IllegalAccessException
java.lang.reflect.InvocationTargetException
- See Also:
Method.invoke(java.lang.Object, java.lang.Object...)
-
-