Search in sources :

Example 1 with ChannelLifecycleHandler

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));
}
Also used : ChannelLifecycleHandler(com.linkedin.r2.netty.handler.common.ChannelLifecycleHandler) SessionResumptionSslHandler(com.linkedin.r2.netty.handler.common.SessionResumptionSslHandler) ClientEntityStreamHandler(com.linkedin.r2.netty.handler.common.ClientEntityStreamHandler) CancelTimeoutHandler(com.linkedin.r2.netty.handler.common.CancelTimeoutHandler) SchemeHandler(com.linkedin.r2.netty.handler.common.SchemeHandler) HttpClientCodec(io.netty.handler.codec.http.HttpClientCodec)

Example 2 with ChannelLifecycleHandler

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));
}
Also used : ChannelLifecycleHandler(com.linkedin.r2.netty.handler.common.ChannelLifecycleHandler) ClientEntityStreamHandler(com.linkedin.r2.netty.handler.common.ClientEntityStreamHandler) CancelTimeoutHandler(com.linkedin.r2.netty.handler.common.CancelTimeoutHandler) SchemeHandler(com.linkedin.r2.netty.handler.common.SchemeHandler)

Aggregations

CancelTimeoutHandler (com.linkedin.r2.netty.handler.common.CancelTimeoutHandler)2 ChannelLifecycleHandler (com.linkedin.r2.netty.handler.common.ChannelLifecycleHandler)2 ClientEntityStreamHandler (com.linkedin.r2.netty.handler.common.ClientEntityStreamHandler)2 SchemeHandler (com.linkedin.r2.netty.handler.common.SchemeHandler)2 SessionResumptionSslHandler (com.linkedin.r2.netty.handler.common.SessionResumptionSslHandler)1 HttpClientCodec (io.netty.handler.codec.http.HttpClientCodec)1