@Override protected void doStart() throws Exception { if (camelContext == null && threadFactory == null) { throw new IllegalArgumentException("Either CamelContext or ThreadFactory must be set on " + this); } startServerBootstrap(); }
@Override protected void doStop() throws Exception { stopServerBootstrap(); }
@Override protected void doStart() throws Exception { super.doStart(); LOG.debug("Netty consumer binding to: {}", configuration.getAddress()); if (nettyServerBootstrapFactory == null) { // setup pipeline factory ServerInitializerFactory pipelineFactory; ServerInitializerFactory factory = configuration.getServerInitializerFactory(); if (factory != null) { pipelineFactory = factory.createPipelineFactory(this); } else { pipelineFactory = new DefaultServerInitializerFactory(this); } if (isTcp()) { if (configuration.isClientMode()) { nettyServerBootstrapFactory = new ClientModeTCPNettyServerBootstrapFactory(); } else { nettyServerBootstrapFactory = new SingleTCPNettyServerBootstrapFactory(); } } else { nettyServerBootstrapFactory = new SingleUDPNettyServerBootstrapFactory(); } nettyServerBootstrapFactory.init(context, configuration, pipelineFactory); } ServiceHelper.startServices(nettyServerBootstrapFactory); LOG.info("Netty consumer bound to: {}", configuration.getAddress()); }