Class ModuleRPCFactory


  • public class ModuleRPCFactory
    extends java.lang.Object
    This factory is used to generate RPC proxies for communication between the client and the gateway. Given an Interface, it will generate a class that will forward calls to the module's RPC handler in the gateway, which should implement the interface.
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static <T> T create​(java.lang.String moduleId, java.lang.Class<T> primaryInterface, java.lang.Class<?>... otherInterfaces)
      Generates a proxy that implements the specified interface and maps calls through module rpc to the specified module in the gateway.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • ModuleRPCFactory

        public ModuleRPCFactory()
    • Method Detail

      • create

        public static <T> T create​(java.lang.String moduleId,
                                   java.lang.Class<T> primaryInterface,
                                   java.lang.Class<?>... otherInterfaces)
        Generates a proxy that implements the specified interface and maps calls through module rpc to the specified module in the gateway.
        Parameters:
        moduleId - the id of the module who implements the same interface in the class returned by GatewayModuleHook.getRPCHandler().
        primaryInterface - the interface that will be created.
        otherInterfaces - if the gateway rpc handler implements multiple interfaces, they will only be available through the proxy if they are specified here. If no other interfaces are used, this parameter can be left out.