R - Type read from the connection held by this handler.W - Type written to the connection held by this handler.public abstract class AbstractConnectionToChannelBridge<R,W> extends BackpressureManagingHandler
Connection instance and the associated Channel.
All operations on Connection will pass through this bridge to an appropriate action on the Channel
Connection.getInput() subscriptionConnection.getInput() if and only if the channel is configured to
not read data automatically (i.e. ChannelOption.AUTO_READ is set to false). Otherwise,
if Connection.getInput() is subscribed lazily, the subscriber always receives an error. The content
in this case is disposed upon reading.BackpressureManagingHandler.RequestReadIfRequiredEvent| Modifier and Type | Field and Description |
|---|---|
protected ConnectionEventListener |
eventListener |
protected EventPublisher |
eventPublisher |
| Modifier | Constructor and Description |
|---|---|
protected |
AbstractConnectionToChannelBridge(java.lang.String thisHandlerName,
io.netty.util.AttributeKey<ConnectionEventListener> eventListenerAttributeKey,
io.netty.util.AttributeKey<EventPublisher> eventPublisherAttributeKey) |
protected |
AbstractConnectionToChannelBridge(java.lang.String thisHandlerName,
ConnectionEventListener eventListener,
EventPublisher eventPublisher) |
| Modifier and Type | Method and Description |
|---|---|
void |
channelInactive(io.netty.channel.ChannelHandlerContext ctx) |
void |
channelUnregistered(io.netty.channel.ChannelHandlerContext ctx) |
protected void |
checkEagerSubscriptionIfConfigured(io.netty.channel.Channel channel) |
protected boolean |
connectionInputSubscriberExists(io.netty.channel.Channel channel) |
void |
exceptionCaught(io.netty.channel.ChannelHandlerContext ctx,
java.lang.Throwable cause) |
protected rx.Subscriber<? super io.netty.channel.Channel> |
getNewChannelSub() |
void |
handlerAdded(io.netty.channel.ChannelHandlerContext ctx) |
protected static boolean |
isValidToEmit(rx.Subscriber<?> subscriber) |
void |
newMessage(io.netty.channel.ChannelHandlerContext ctx,
java.lang.Object msg) |
protected void |
onNewReadSubscriber(rx.Subscriber<? super R> subscriber) |
boolean |
shouldReadMore(io.netty.channel.ChannelHandlerContext ctx) |
void |
userEventTriggered(io.netty.channel.ChannelHandlerContext ctx,
java.lang.Object evt) |
channelRead, channelReadComplete, handlerRemoved, read, writebind, close, connect, deregister, disconnect, flushprotected ConnectionEventListener eventListener
protected EventPublisher eventPublisher
protected AbstractConnectionToChannelBridge(java.lang.String thisHandlerName,
ConnectionEventListener eventListener,
EventPublisher eventPublisher)
protected AbstractConnectionToChannelBridge(java.lang.String thisHandlerName,
io.netty.util.AttributeKey<ConnectionEventListener> eventListenerAttributeKey,
io.netty.util.AttributeKey<EventPublisher> eventPublisherAttributeKey)
public void handlerAdded(io.netty.channel.ChannelHandlerContext ctx)
throws java.lang.Exception
handlerAdded in interface io.netty.channel.ChannelHandlerhandlerAdded in class BackpressureManagingHandlerjava.lang.Exceptionpublic void channelInactive(io.netty.channel.ChannelHandlerContext ctx)
throws java.lang.Exception
channelInactive in interface io.netty.channel.ChannelInboundHandlerchannelInactive in class io.netty.channel.ChannelInboundHandlerAdapterjava.lang.Exceptionpublic void channelUnregistered(io.netty.channel.ChannelHandlerContext ctx)
throws java.lang.Exception
channelUnregistered in interface io.netty.channel.ChannelInboundHandlerchannelUnregistered in class io.netty.channel.ChannelInboundHandlerAdapterjava.lang.Exceptionpublic void userEventTriggered(io.netty.channel.ChannelHandlerContext ctx,
java.lang.Object evt)
throws java.lang.Exception
userEventTriggered in interface io.netty.channel.ChannelInboundHandleruserEventTriggered in class BackpressureManagingHandlerjava.lang.Exceptionpublic void newMessage(io.netty.channel.ChannelHandlerContext ctx,
java.lang.Object msg)
newMessage in class BackpressureManagingHandlerpublic boolean shouldReadMore(io.netty.channel.ChannelHandlerContext ctx)
shouldReadMore in class BackpressureManagingHandlerpublic void exceptionCaught(io.netty.channel.ChannelHandlerContext ctx,
java.lang.Throwable cause)
throws java.lang.Exception
exceptionCaught in interface io.netty.channel.ChannelHandlerexceptionCaught in interface io.netty.channel.ChannelInboundHandlerexceptionCaught in class io.netty.channel.ChannelInboundHandlerAdapterjava.lang.Exceptionprotected static boolean isValidToEmit(rx.Subscriber<?> subscriber)
protected boolean connectionInputSubscriberExists(io.netty.channel.Channel channel)
protected void onNewReadSubscriber(rx.Subscriber<? super R> subscriber)
protected final void checkEagerSubscriptionIfConfigured(io.netty.channel.Channel channel)
protected final rx.Subscriber<? super io.netty.channel.Channel> getNewChannelSub()