public int serverPort() { return server.getServerPort(); } }
@Override public HttpServer<I, O> start() { super.start(); return this; }
public void shutdown() { try { server.shutdown(); } catch (InterruptedException e) { // IGONRE } }
@PostConstruct public void start() { server = RxNetty.newTcpServerBuilder(serverPort, tcpHandlerProvider.get()) .pipelineConfigurator(pipelineConfigurator) .withMetricEventsListenerFactory(servoEventsListenerFactory) .build() // .withErrorHandler() TODO use a custom handler (?) as the default emits extraneous error logs .start(); logger.info("Starting {} on port {} with {} encoding...", getClass().getSimpleName(), server.getServerPort(), config.getCodec()); }
@PreDestroy public void shutdown() throws InterruptedException { if (server != null) { logger.info("Starting WebSockets server {} on port {}...", nameAnnotation.value(), server.getServerPort()); server.shutdown(); } }
public RxServer(ServerBootstrap bootstrap, int port, final PipelineConfigurator<I, O> pipelineConfigurator, final ConnectionHandler<I, O> connectionHandler, EventExecutorGroup connHandlingExecutor) { super(bootstrap, port); this.pipelineConfigurator = pipelineConfigurator; bootstrap.childHandler(newChannelInitializer(pipelineConfigurator, connectionHandler, connHandlingExecutor)); } }
@Override public HttpServer<I, O> withErrorHandler(ErrorHandler errorHandler) { super.withErrorHandler(errorHandler); return this; }
@Override protected RxServer<I, O> createServer() { return new RxServer<I, O>(serverBootstrap, port, pipelineConfigurator, connectionHandler, eventExecutorGroup); }
@Inject public void setInjector(Injector injector) { ServerConfig config = injector.getInstance(serverConfigKey); ConnectionHandler<I, O> connectionHandler = injector.getInstance(connectionHandlerKey); ServerBuilder<I, O> builder = RxNetty.newTcpServerBuilder(config.getPort(), connectionHandler); if (injector.getExistingBinding(pipelineConfiguratorKey) != null) { builder.appendPipelineConfigurator(injector.getInstance(pipelineConfiguratorKey)); } if (injector.getExistingBinding(metricEventsListenerFactoryKey) != null) { builder.withMetricEventsListenerFactory(injector.getInstance(metricEventsListenerFactoryKey)); } server = builder.build().start(); logger.info("Starting server {} on port {}...", nameAnnotation.value(), server.getServerPort()); } }
@PreDestroy public void shutdown() throws InterruptedException { if (server != null) { logger.info("Starting WebSockets server {} on port {}...", nameAnnotation.value(), server.getServerPort()); server.shutdown(); } }
public RxServer(ServerBootstrap bootstrap, int port, final PipelineConfigurator<I, O> pipelineConfigurator, final ConnectionHandler<I, O> connectionHandler, EventExecutorGroup connHandlingExecutor) { super(bootstrap, port); this.pipelineConfigurator = pipelineConfigurator; bootstrap.childHandler(newChannelInitializer(pipelineConfigurator, connectionHandler, connHandlingExecutor)); } }
@Override public HttpServer<I, O> withErrorHandler(ErrorHandler errorHandler) { super.withErrorHandler(errorHandler); return this; }
@Override protected RxServer<I, O> createServer() { return new RxServer<I, O>(serverBootstrap, port, pipelineConfigurator, connectionHandler, eventExecutorGroup); }
@Inject public void setInjector(Injector injector) { ServerConfig config = injector.getInstance(serverConfigKey); ConnectionHandler<I, O> connectionHandler = injector.getInstance(connectionHandlerKey); ServerBuilder<I, O> builder = RxNetty.newTcpServerBuilder(config.getPort(), connectionHandler); if (injector.getExistingBinding(pipelineConfiguratorKey) != null) { builder.appendPipelineConfigurator(injector.getInstance(pipelineConfiguratorKey)); } if (injector.getExistingBinding(metricEventsListenerFactoryKey) != null) { builder.withMetricEventsListenerFactory(injector.getInstance(metricEventsListenerFactoryKey)); } server = builder.build().start(); logger.info("Starting server {} on port {}...", nameAnnotation.value(), server.getServerPort()); } }
public int serverPort() { return server == null ? -1 : server.getServerPort(); }
@PreDestroy public void shutdown() throws InterruptedException { if (server != null) { logger.info("Starting WebSockets server {} on port {}...", nameAnnotation.value(), server.getServerPort()); server.shutdown(); } }
public void shutdown() throws InterruptedException { shutdownCmdServer.shutdown(); }
@Override public HttpServer<I, O> start() { super.start(); return this; }
@Inject public void setInjector(Injector injector) { ServerConfig config = injector.getInstance(serverConfigKey); ConnectionHandler<I, O> connectionHandler = injector.getInstance(connectionHandlerKey); ServerBuilder<I, O> builder = RxNetty.newTcpServerBuilder(config.getPort(), connectionHandler); if (injector.getExistingBinding(pipelineConfiguratorKey) != null) { builder.appendPipelineConfigurator(injector.getInstance(pipelineConfiguratorKey)); } if (injector.getExistingBinding(metricEventsListenerFactoryKey) != null) { builder.withMetricEventsListenerFactory(injector.getInstance(metricEventsListenerFactoryKey)); } server = builder.build().start(); logger.info("Starting server {} on port {}...", nameAnnotation.value(), server.getServerPort()); } }
public int getShutdownPort() { return shutdownCmdServer.getServerPort(); }