@Override public ServerInitializerFactory createPipelineFactory(NettyConsumer consumer) { return new DefaultServerInitializerFactory(consumer); }
@Deprecated public DefaultServerInitializerFactory(NettyServerBootstrapConfiguration configuration) { this.consumer = null; try { this.sslContext = createSSLContext(null, configuration); } catch (Exception e) { throw ObjectHelper.wrapRuntimeCamelException(e); } if (sslContext != null) { LOG.info("Created SslContext {}", sslContext); } }
SslHandler sslHandler = configureServerSSLOnDemand(); if (sslHandler != null) { addToPipeline("ssl", channelPipeline, sslHandler); addToPipeline("encoder-" + x, channelPipeline, encoder); addToPipeline("decoder-" + x, channelPipeline, decoder); addToPipeline("handler", channelPipeline, applicationExecutor, new ServerChannelHandler(consumer)); addToPipeline("handler", channelPipeline, new ServerChannelHandler(consumer));
public DefaultServerInitializerFactory(NettyConsumer consumer) { this.consumer = consumer; try { this.sslContext = createSSLContext(consumer.getContext(), consumer.getConfiguration()); } catch (Exception e) { throw ObjectHelper.wrapRuntimeCamelException(e); } if (sslContext != null) { LOG.info("Created SslContext {}", sslContext); } }
@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()); }