/**
* Add a {@link ChannelHandler} with {@link #addHandlerFirst} if of type of
* {@link io.netty.channel.ChannelOutboundHandler} otherwise with
* {@link #addHandlerLast}. Implementation may add more auto handling in particular
* HTTP based context will prepend an HttpContent body extractor.
* <p>
* {@code [ [reactor codecs], [<- user FIRST HANDLERS added here, user LAST HANDLERS added here ->], [reactor handlers] ]}
* <p>
* If effectively added, the handler will be safely removed when the channel is made
* inactive (pool release).
*
* @param name handler name
* @param handler handler instance
*
* @return this NettyContext
*/
default NettyContext addHandler(String name, ChannelHandler handler){
if(handler instanceof ChannelOutboundHandler){
addHandlerFirst(name, handler);
}
else {
addHandlerLast(name, handler);
}
return this;
}
NettyContext.java 文件源码
java
阅读 22
收藏 0
点赞 0
评论 0
项目:reactor-netty
作者:
评论列表
文章目录