/** * Bind desired port and start network service. Before starting network service, {@link NettyRestServer} * will initialize its configuration. * */ @Override public void start() { if (handler == null) { throw new IllegalStateException("ChannelHandler is null."); } super.init(new NettyRestChannelInitializer(handler), workerCount); super.start(); }
/** * Bind desired port and start network service. Before starting network service, {@link NettyRestServer} * will initialize its configuration. * */ @Override public void start() { if (handler == null) { throw new IllegalStateException("ChannelHandler is null."); } super.init(new NettyRestChannelInitializer(handler), workerCount); super.start(); }
public AsyncRpcServer(final Class<?> protocol, final Object instance, final InetSocketAddress bindAddress, final int threads) throws Exception { super(protocol.getSimpleName(), bindAddress); String serviceClassName = protocol.getName() + "$" + protocol.getSimpleName() + "Service"; Class<?> serviceClass = Class.forName(serviceClassName); Class<?> interfaceClass = Class.forName(serviceClassName + "$Interface"); Method method = serviceClass.getMethod("newReflectiveService", interfaceClass); this.service = (Service) method.invoke(null, instance); this.initializer = new ProtoServerChannelInitializer(new ServerHandler(), RpcRequest.getDefaultInstance()); super.init(this.initializer, threads); }
public AsyncRpcServer(final Class<?> protocol, final Object instance, final InetSocketAddress bindAddress, final int threads) throws Exception { super(protocol.getSimpleName(), bindAddress); String serviceClassName = protocol.getName() + "$" + protocol.getSimpleName() + "Service"; Class<?> serviceClass = Class.forName(serviceClassName); Class<?> interfaceClass = Class.forName(serviceClassName + "$Interface"); Method method = serviceClass.getMethod("newReflectiveService", interfaceClass); this.service = (Service) method.invoke(null, instance); this.initializer = new ProtoServerChannelInitializer(new ServerHandler(), RpcRequest.getDefaultInstance()); super.init(this.initializer, threads); }
public AsyncRpcServer(final Class<?> protocol, final Object instance, final InetSocketAddress bindAddress, final int workerNum) throws Exception { super(protocol.getSimpleName(), bindAddress); String serviceClassName = protocol.getName() + "$" + protocol.getSimpleName() + "Service"; Class<?> serviceClass = Class.forName(serviceClassName); Class<?> interfaceClass = Class.forName(serviceClassName + "$Interface"); Method method = serviceClass.getMethod("newReflectiveService", interfaceClass); this.service = (Service) method.invoke(null, instance); this.initializer = new ProtoChannelInitializer(new ServerHandler(), RpcRequest.getDefaultInstance()); super.init(this.initializer, workerNum); }
public BlockingRpcServer(final Class<?> protocol, final Object instance, final InetSocketAddress bindAddress, final int threads) throws Exception { super(protocol.getSimpleName(), bindAddress); String serviceClassName = protocol.getName() + "$" + protocol.getSimpleName() + "Service"; Class<?> serviceClass = Class.forName(serviceClassName); Class<?> interfaceClass = Class.forName(serviceClassName + "$BlockingInterface"); Method method = serviceClass.getMethod( "newReflectiveBlockingService", interfaceClass); this.service = (BlockingService) method.invoke(null, instance); this.initializer = new ProtoServerChannelInitializer(new ServerHandler(), RpcRequest.getDefaultInstance()); super.init(this.initializer, threads); }
public BlockingRpcServer(final Class<?> protocol, final Object instance, final InetSocketAddress bindAddress, final int threads) throws Exception { super(protocol.getSimpleName(), bindAddress); String serviceClassName = protocol.getName() + "$" + protocol.getSimpleName() + "Service"; Class<?> serviceClass = Class.forName(serviceClassName); Class<?> interfaceClass = Class.forName(serviceClassName + "$BlockingInterface"); Method method = serviceClass.getMethod( "newReflectiveBlockingService", interfaceClass); this.service = (BlockingService) method.invoke(null, instance); this.initializer = new ProtoServerChannelInitializer(new ServerHandler(), RpcRequest.getDefaultInstance()); super.init(this.initializer, threads); }
public BlockingRpcServer(final Class<?> protocol, final Object instance, final InetSocketAddress bindAddress, final int workerNum) throws Exception { super(protocol.getSimpleName(), bindAddress); String serviceClassName = protocol.getName() + "$" + protocol.getSimpleName() + "Service"; Class<?> serviceClass = Class.forName(serviceClassName); Class<?> interfaceClass = Class.forName(serviceClassName + "$BlockingInterface"); Method method = serviceClass.getMethod( "newReflectiveBlockingService", interfaceClass); this.service = (BlockingService) method.invoke(null, instance); this.initializer = new ProtoChannelInitializer(new ServerHandler(), RpcRequest.getDefaultInstance()); super.init(this.initializer, workerNum); }