use of com.linkedin.r2.netty.handler.common.ChannelLifecycleHandler in project rest.li by linkedin.
the class HttpChannelInitializer method initChannel.
@Override
protected void initChannel(NioSocketChannel channel) {
if (_ssl) {
channel.pipeline().addLast(SessionResumptionSslHandler.PIPELINE_SESSION_RESUMPTION_HANDLER, new SessionResumptionSslHandler(_sslContext, _sslParameters, _enableSSLSessionResumption, _sslHandShakeTimeout));
}
channel.pipeline().addLast("codec", new HttpClientCodec(_maxInitialLineLength, _maxHeaderSize, _maxChunkSize));
channel.pipeline().addLast("outboundRestRequestEncoder", HttpMessageEncoders.newRestRequestEncoder());
channel.pipeline().addLast("outboundStreamDataEncoder", HttpMessageEncoders.newDataEncoder());
channel.pipeline().addLast("outboundStreamRequestEncoder", HttpMessageEncoders.newStreamRequestEncoder());
channel.pipeline().addLast("inboundDataDecoder", HttpMessageDecoders.newDataDecoder());
channel.pipeline().addLast("inboundRequestDecoder", HttpMessageDecoders.newResponseDecoder());
channel.pipeline().addLast("schemeHandler", new SchemeHandler(_ssl ? HttpScheme.HTTPS.toString() : HttpScheme.HTTP.toString()));
channel.pipeline().addLast("streamDuplexHandler", new ClientEntityStreamHandler(_maxContentLength));
channel.pipeline().addLast("timeoutHandler", new CancelTimeoutHandler());
channel.pipeline().addLast("channelPoolHandler", new ChannelLifecycleHandler(RECYCLE_CHANNEL));
}
use of com.linkedin.r2.netty.handler.common.ChannelLifecycleHandler in project rest.li by linkedin.
the class Http2StreamChannelInitializer method initChannel.
@Override
protected void initChannel(Channel channel) {
channel.pipeline().addLast("outboundRestRequestEncoder", Http2MessageEncoders.newRestRequestEncoder());
channel.pipeline().addLast("outboundStreamDataEncoder", Http2MessageEncoders.newDataEncoder());
channel.pipeline().addLast("outboundStreamRequestEncoder", Http2MessageEncoders.newStreamRequestEncoder());
channel.pipeline().addLast("inboundDataDecoder", Http2MessageDecoders.newDataDecoder());
channel.pipeline().addLast("inboundRequestDecoder", Http2MessageDecoders.newResponseDecoder());
channel.pipeline().addLast("schemeHandler", new SchemeHandler(_ssl ? HttpScheme.HTTPS.toString() : HttpScheme.HTTP.toString()));
channel.pipeline().addLast("streamDuplexHandler", new ClientEntityStreamHandler(_maxContentLength));
channel.pipeline().addLast("timeoutHandler", new CancelTimeoutHandler());
channel.pipeline().addLast("channelPoolHandler", new ChannelLifecycleHandler(CHANNEL_RECYCLE));
}
Aggregations