类 NettyServer


  • public class NettyServer
    extends Object
    netty服务器端实现类 Server-side implementation class
    作者:
    tag 2019/2/21
    • 构造器详细资料

      • NettyServer

        public NettyServer()
    • 方法详细资料

      • getInstance

        public static NettyServer getInstance​(ModuleE moduleE)
        根据预定义模块获得一个服务实例 Get a server instance with predefined module
        参数:
        moduleE - 预定义模块 / Pre-defined module
        返回:
        WsServer
      • getInstance

        public static NettyServer getInstance​(String abbr,
                                              String name,
                                              String domain)
        根据参数获得一个服务实例 Get a server instance with Abbreviation & Name
        参数:
        abbr - 角色 / Role
        name - 名称 / Name
        domain - 域名 / Domian
        返回:
        WsServer
      • startServer

        public static void startServer​(int port,
                                       String host,
                                       String path)
        启动netty服务器,监听指定端口 Start the netty server to listen on the specified port
      • startServer

        public static void startServer​(int port)
        启动netty服务器,监听指定端口 Start the netty server to listen on the specified port
      • dependencies

        public NettyServer dependencies​(String key,
                                        String value)
        设置本模块的依赖角色 Setting Dependent Roles for this Module
        参数:
        key - 依赖的角色 / Dependent roles
        value - 依赖角色的版本 / Version of dependent roles
        返回:
        WsServer
      • moduleRoles

        public NettyServer moduleRoles​(String[] value)
        设置本模块的角色(角色名默认为模块编号) Setting up the role of this module(Role name defaults to module code)
        参数:
        value - 角色版本 / Version of role
        返回:
        WsServer
      • moduleRoles

        public NettyServer moduleRoles​(String key,
                                       String[] value)
        设置本模块的角色 Setting up the role of this module
        参数:
        key - 角色 / Role
        value - 角色版本 / Version of role
        返回:
        WsServer
      • moduleVersion

        public NettyServer moduleVersion​(String moduleVersion)
        设置模块版本 Set module version
        参数:
        moduleVersion - 模块的版本 / Version of module
        返回:
        WsServer
      • scanPackage

        public NettyServer scanPackage​(Set<String> scanPackage)
                                throws Exception
        扫描指定路径,得到所有接口的详细信息 Scan the specified path for details of all interfaces
        参数:
        scanPackage - 需要扫描的包路径 / Packet paths to be scanned
        返回:
        WsServer
        抛出:
        Exception - 找到重复命令(cmd) / Find duplicate commands (cmd)
      • addCmdDetail

        public NettyServer addCmdDetail​(Class<?> cmdClass)
        添加RPC接口 add RPC insterface
        参数:
        cmdClass -
        返回: