Class 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
    • Constructor Detail

      • HubXmlRpcHandler

        public HubXmlRpcHandler​(SampXmlRpcClientFactory xClientFactory,
                                ClientProfile profile,
                                java.lang.String secret,
                                KeyGenerator keyGen)
        Constructor.
        Parameters:
        xClientFactory - XML-RPC client factory implementation
        profile - hub connection factory
        secret - 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 is return 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.

        Specified by:
        invokeMethod in class ActorHandler
        Parameters:
        method - method to invoke
        obj - object to invoke the method on
        args - arguments for the method call
        Throws:
        java.lang.IllegalAccessException
        java.lang.reflect.InvocationTargetException
        See Also:
        Method.invoke(java.lang.Object, java.lang.Object...)