Refine search
@Override public Unmarshaller getUnmarshaller(ChannelHandlerContext ctx) throws Exception { Attribute<Unmarshaller> attr = ctx.channel().attr(UNMARSHALLER); Unmarshaller unmarshaller = attr.get(); if (unmarshaller == null) { unmarshaller = super.getUnmarshaller(ctx); attr.set(unmarshaller); } return unmarshaller; } }
@Override public Unmarshaller getUnmarshaller(ChannelHandlerContext ctx) throws Exception { Attribute<Unmarshaller> attr = ctx.channel().attr(UNMARSHALLER); Unmarshaller unmarshaller = attr.get(); if (unmarshaller == null) { unmarshaller = super.getUnmarshaller(ctx); attr.set(unmarshaller); } return unmarshaller; } }
@Override public void channelActive(ChannelHandlerContext ctx) throws Exception { // Store a ref to the count of current inflight requests onto this channel. So that // other code can query it using getInflightRequestCountFromChannel(). ctx.channel().attr(ATTR_CURRENT_REQS).set(currentRequests); super.channelActive(ctx); }
@Override protected void configurePipeline(ChannelHandlerContext ctx, String protocol) throws Exception { if (ApplicationProtocolNames.HTTP_2.equals(protocol)) { ctx.channel().attr(PROTOCOL_NAME).set("HTTP/2"); configureHttp2(ctx.pipeline()); return; } if (ApplicationProtocolNames.HTTP_1_1.equals(protocol)) { ctx.channel().attr(PROTOCOL_NAME).set("HTTP/1.1"); configureHttp1(ctx.pipeline()); return; } throw new IllegalStateException("unknown protocol: " + protocol); }