Example usage for io.netty.channel ChannelPipeline get

List of usage examples for io.netty.channel ChannelPipeline get

Introduction

In this page you can find the example usage for io.netty.channel ChannelPipeline get.

Prototype

<T extends ChannelHandler> T get(Class<T> handlerType);

Source Link

Document

Returns the ChannelHandler of the specified type in this pipeline.

Usage

From source file:org.wso2.carbon.transport.http.netty.sender.channel.TargetChannel.java

License:Open Source License

public void setCorrelationIdForLogging() {
    ChannelPipeline pipeline = this.getChannel().pipeline();
    SourceHandler srcHandler = this.getCorrelatedSource();
    if (srcHandler != null && pipeline.get(Constants.HTTP_TRACE_LOG_HANDLER) != null) {
        HTTPTraceLoggingHandler loggingHandler = (HTTPTraceLoggingHandler) pipeline
                .get(Constants.HTTP_TRACE_LOG_HANDLER);
        loggingHandler//w w w.j ava  2 s. c om
                .setCorrelatedSourceId(srcHandler.getInboundChannelContext().channel().id().asShortText());
    }
}

From source file:reactor.ipc.netty.http.server.CompressionHandler.java

License:Open Source License

void addCompressionHandlerOnce(ChannelHandlerContext ctx, ChannelPipeline cp) {
    if (cp.get(FilteringHttpContentCompressor.class) == null) {
        ctx.pipeline().addBefore(NettyPipeline.CompressionHandler, NettyPipeline.HttpCompressor,
                new FilteringHttpContentCompressor());
    }//from w w w.  j  av  a 2 s .c  o  m
}