public class NettyChannelHandlerBridge<IN,OUT>
extends io.netty.channel.ChannelDuplexHandler
ChannelInboundHandler
implementation that passes data to a Reactor ChannelStream
.Modifier and Type | Class and Description |
---|---|
static class |
NettyChannelHandlerBridge.ChannelInputSubscriberEvent<IN>
|
Modifier and Type | Field and Description |
---|---|
protected static AtomicIntegerFieldUpdater<NettyChannelHandlerBridge> |
CHANNEL_REF |
protected NettyChannelStream<IN,OUT> |
channelStream |
protected PushSubscription<IN> |
channelSubscription |
protected ReactorChannelHandler<IN,OUT,ChannelStream<IN,OUT>> |
handler |
protected static org.slf4j.Logger |
log |
Constructor and Description |
---|
NettyChannelHandlerBridge(ReactorChannelHandler<IN,OUT,ChannelStream<IN,OUT>> handler,
NettyChannelStream<IN,OUT> channelStream) |
Modifier and Type | Method and Description |
---|---|
void |
channelActive(io.netty.channel.ChannelHandlerContext ctx) |
void |
channelInactive(io.netty.channel.ChannelHandlerContext ctx) |
void |
channelRead(io.netty.channel.ChannelHandlerContext ctx,
Object msg) |
void |
channelReadComplete(io.netty.channel.ChannelHandlerContext ctx) |
protected static io.netty.buffer.ByteBuf |
convertBufferToByteBuff(io.netty.channel.ChannelHandlerContext ctx,
Buffer data) |
protected void |
doOnSubscribe(io.netty.channel.ChannelHandlerContext ctx,
org.reactivestreams.Subscription s) |
protected void |
doOnTerminate(io.netty.channel.ChannelHandlerContext ctx,
io.netty.channel.ChannelFuture last,
io.netty.channel.ChannelPromise promise) |
protected io.netty.channel.ChannelFuture |
doOnWrite(Object data,
io.netty.channel.ChannelHandlerContext ctx) |
protected void |
doRead(io.netty.channel.ChannelHandlerContext ctx,
Object msg) |
void |
exceptionCaught(io.netty.channel.ChannelHandlerContext ctx,
Throwable cause) |
NettyChannelStream<IN,OUT> |
getChannelStream() |
ReactorChannelHandler<IN,OUT,ChannelStream<IN,OUT>> |
getHandler() |
PushSubscription<IN> |
subscription() |
void |
userEventTriggered(io.netty.channel.ChannelHandlerContext ctx,
Object evt) |
void |
write(io.netty.channel.ChannelHandlerContext ctx,
Object msg,
io.netty.channel.ChannelPromise promise) |
bind, close, connect, deregister, disconnect, flush, read
channelRegistered, channelUnregistered, channelWritabilityChanged
handlerAdded, handlerRemoved, isSharable
protected static final org.slf4j.Logger log
protected final ReactorChannelHandler<IN,OUT,ChannelStream<IN,OUT>> handler
protected final NettyChannelStream<IN,OUT> channelStream
protected PushSubscription<IN> channelSubscription
protected static final AtomicIntegerFieldUpdater<NettyChannelHandlerBridge> CHANNEL_REF
public NettyChannelHandlerBridge(ReactorChannelHandler<IN,OUT,ChannelStream<IN,OUT>> handler, NettyChannelStream<IN,OUT> channelStream)
public PushSubscription<IN> subscription()
public void userEventTriggered(io.netty.channel.ChannelHandlerContext ctx, Object evt) throws Exception
userEventTriggered
in interface io.netty.channel.ChannelInboundHandler
userEventTriggered
in class io.netty.channel.ChannelInboundHandlerAdapter
Exception
public void channelActive(io.netty.channel.ChannelHandlerContext ctx) throws Exception
channelActive
in interface io.netty.channel.ChannelInboundHandler
channelActive
in class io.netty.channel.ChannelInboundHandlerAdapter
Exception
public void channelReadComplete(io.netty.channel.ChannelHandlerContext ctx) throws Exception
channelReadComplete
in interface io.netty.channel.ChannelInboundHandler
channelReadComplete
in class io.netty.channel.ChannelInboundHandlerAdapter
Exception
public void channelInactive(io.netty.channel.ChannelHandlerContext ctx) throws Exception
channelInactive
in interface io.netty.channel.ChannelInboundHandler
channelInactive
in class io.netty.channel.ChannelInboundHandlerAdapter
Exception
public void channelRead(io.netty.channel.ChannelHandlerContext ctx, Object msg) throws Exception
channelRead
in interface io.netty.channel.ChannelInboundHandler
channelRead
in class io.netty.channel.ChannelInboundHandlerAdapter
Exception
protected final void doRead(io.netty.channel.ChannelHandlerContext ctx, Object msg)
public void write(io.netty.channel.ChannelHandlerContext ctx, Object msg, io.netty.channel.ChannelPromise promise) throws Exception
write
in interface io.netty.channel.ChannelOutboundHandler
write
in class io.netty.channel.ChannelDuplexHandler
Exception
public void exceptionCaught(io.netty.channel.ChannelHandlerContext ctx, Throwable cause) throws Exception
exceptionCaught
in interface io.netty.channel.ChannelHandler
exceptionCaught
in interface io.netty.channel.ChannelInboundHandler
exceptionCaught
in class io.netty.channel.ChannelInboundHandlerAdapter
Exception
protected io.netty.channel.ChannelFuture doOnWrite(Object data, io.netty.channel.ChannelHandlerContext ctx)
protected static io.netty.buffer.ByteBuf convertBufferToByteBuff(io.netty.channel.ChannelHandlerContext ctx, Buffer data)
protected void doOnTerminate(io.netty.channel.ChannelHandlerContext ctx, io.netty.channel.ChannelFuture last, io.netty.channel.ChannelPromise promise)
protected void doOnSubscribe(io.netty.channel.ChannelHandlerContext ctx, org.reactivestreams.Subscription s)
public ReactorChannelHandler<IN,OUT,ChannelStream<IN,OUT>> getHandler()
public NettyChannelStream<IN,OUT> getChannelStream()
Copyright © 2016. All rights reserved.