use of org.apache.flink.shaded.netty4.io.netty.channel.ChannelPipeline in project cxf by apache.
the class NettyHttpClientPipelineFactory method initChannel.
@Override
protected void initChannel(Channel ch) throws Exception {
ChannelPipeline pipeline = ch.pipeline();
SslHandler sslHandler = configureClientSSLOnDemand();
if (sslHandler != null) {
LOG.log(Level.FINE, "Server SSL handler configured and added as an interceptor against the ChannelPipeline: {}", sslHandler);
pipeline.addLast("ssl", sslHandler);
}
pipeline.addLast("decoder", new HttpResponseDecoder());
pipeline.addLast("aggregator", new HttpObjectAggregator(maxContentLength));
pipeline.addLast("encoder", new HttpRequestEncoder());
pipeline.addLast("chunkedWriter", new ChunkedWriteHandler());
if (readTimeout > 0) {
pipeline.addLast("readTimeoutHandler", new ReadTimeoutHandler(readTimeout, TimeUnit.MILLISECONDS));
}
pipeline.addLast("client", new NettyHttpClientHandler());
}
use of org.apache.flink.shaded.netty4.io.netty.channel.ChannelPipeline in project cxf by apache.
the class NettyHttpServletPipelineFactory method initChannel.
@Override
protected void initChannel(Channel ch) throws Exception {
if (!enableHttp2) {
final ChannelPipeline pipeline = getDefaultHttpChannelPipeline(ch);
pipeline.addLast(applicationExecutor, "handler", this.getServletHandler());
} else {
getDefaultHttp2ChannelPipeline(ch);
}
}
use of org.apache.flink.shaded.netty4.io.netty.channel.ChannelPipeline in project cxf by apache.
the class NettyHttpServletPipelineFactory method getDefaultHttpChannelPipeline.
protected ChannelPipeline getDefaultHttpChannelPipeline(Channel channel) throws Exception {
// Create a default pipeline implementation.
ChannelPipeline pipeline = channel.pipeline();
SslHandler sslHandler = configureServerHttpSSLOnDemand();
if (sslHandler != null) {
LOG.log(Level.FINE, "Server SSL handler configured and added as an interceptor against the ChannelPipeline: {}", sslHandler);
pipeline.addLast("ssl", sslHandler);
}
configureDefaultHttpPipeline(pipeline);
return pipeline;
}
use of org.apache.flink.shaded.netty4.io.netty.channel.ChannelPipeline in project qpid-broker-j by apache.
the class AbstractFrameTransport method connect.
public AbstractFrameTransport<I> connect() {
try {
Bootstrap b = new Bootstrap();
b.group(_workerGroup);
b.channel(NioSocketChannel.class);
b.option(ChannelOption.SO_KEEPALIVE, true);
b.handler(new ChannelInitializer<SocketChannel>() {
@Override
public void initChannel(SocketChannel ch) throws Exception {
ChannelPipeline pipeline = ch.pipeline();
buildInputOutputPipeline(pipeline);
}
});
_channel = b.connect(_brokerAddress).sync().channel();
_channel.closeFuture().addListener(future -> {
_channelClosedSeen = true;
_queue.add(CHANNEL_CLOSED_RESPONSE);
});
} catch (InterruptedException e) {
throw new RuntimeException(e);
}
return this;
}
use of org.apache.flink.shaded.netty4.io.netty.channel.ChannelPipeline in project ambry by linkedin.
the class Http2BlockingChannelStreamChannelInitializer method initChannel.
@Override
protected void initChannel(Channel ch) throws Exception {
ChannelPipeline p = ch.pipeline();
p.addLast(http2StreamFrameToHttpObjectCodec);
p.addLast(new HttpObjectAggregator(http2ClientConfig.http2MaxContentLength));
p.addLast(http2BlockingChannelResponseHandler);
p.addLast(ambrySendToHttp2Adaptor);
}
Aggregations