private void setActiveOnOpen(boolean activeOnOpen) { if (channel.isRegistered()) { throw new IllegalStateException("Can only changed before channel was registered"); } this.activeOnOpen = activeOnOpen; }
private void setActiveOnOpen(boolean activeOnOpen) { if (channel.isRegistered()) { throw new IllegalStateException("Can only changed before channel was registered"); } this.activeOnOpen = activeOnOpen; }
private void setActiveOnOpen(boolean activeOnOpen) { if (channel.isRegistered()) { throw new IllegalStateException("Can only changed before channel was registered"); } this.activeOnOpen = activeOnOpen; }
private void setActiveOnOpen(boolean activeOnOpen) { if (channel.isRegistered()) { throw new IllegalStateException("Can only changed before channel was registered"); } this.activeOnOpen = activeOnOpen; }
private void checkChannelNotRegistered() { if (channel.isRegistered()) { throw new IllegalStateException("EpollMode can only be changed before channel is registered"); } }
public boolean isActive() { return (channel.isActive() && channel.isRegistered()); }
private void fireException0(Throwable cause) { // Only fire the exception if the channel is open and registered // if not the pipeline is not setup and so it would hit the tail // of the pipeline. // See https://github.com/netty/netty/issues/1517 if (fireExceptionListener != null && channel.isRegistered()) { channel.pipeline().fireExceptionCaught(cause); } } }
private void fireException0(Throwable cause) { // Only fire the exception if the channel is open and registered // if not the pipeline is not setup and so it would hit the tail // of the pipeline. // See https://github.com/netty/netty/issues/1517 if (fireExceptionListener != null && channel.isRegistered()) { channel.pipeline().fireExceptionCaught(cause); } } }
@Override public void handlerAdded(ChannelHandlerContext ctx) throws Exception { if (ctx.channel().isActive() && ctx.channel().isRegistered()) { // channelActive() event has been fired already, which means this.channelActive() will // not be invoked. We have to initialize here instead. initialize(ctx); } else { // channelActive() event has not been fired yet. this.channelActive() will be invoked // and initialization will occur there. } }
@Override protected void checkDeadLock() { if (channel().isRegistered()) { super.checkDeadLock(); } }
@Override protected void checkDeadLock() { if (channel().isRegistered()) { super.checkDeadLock(); } }
/** * {@inheritDoc} If override this method ensure you call super! */ @Override public void handlerAdded(ChannelHandlerContext ctx) throws Exception { if (ctx.channel().isRegistered()) { // This should always be true with our current DefaultChannelPipeline implementation. // The good thing about calling initChannel(...) in handlerAdded(...) is that there will be no ordering // surprises if a ChannelInitializer will add another ChannelInitializer. This is as all handlers // will be added in the expected order. if (initChannel(ctx)) { // We are done with init the Channel, removing the initializer now. removeState(ctx); } } }
public boolean isActive() { return (channel.isActive() && channel.isRegistered()); }
@Override protected void checkDeadLock() { if (channel().isRegistered()) { super.checkDeadLock(); } }
@Override protected void checkDeadLock() { if (channel().isRegistered()) { super.checkDeadLock(); } }
/** * {@inheritDoc} If override this method ensure you call super! */ @Override public void handlerAdded(ChannelHandlerContext ctx) throws Exception { if (ctx.channel().isRegistered()) { // This should always be true with our current DefaultChannelPipeline implementation. // The good thing about calling initChannel(...) in handlerAdded(...) is that there will be no ordering // surprises if a ChannelInitializer will add another ChannelInitializer. This is as all handlers // will be added in the expected order. if (initChannel(ctx)) { // We are done with init the Channel, removing the initializer now. removeState(ctx); } } }
public static String channelInfoForLogging(Channel ch) { if (ch == null) { return "null"; } String channelInfo = ch.toString() + ", active=" + ch.isActive() + ", open=" + ch.isOpen() + ", registered=" + ch.isRegistered() + ", writable=" + ch.isWritable() + ", id=" + ch.id(); CurrentPassport passport = CurrentPassport.fromChannel(ch); return "Channel: " + channelInfo + ", Passport: " + String.valueOf(passport); } }
public static String channelInfoForLogging(Channel ch) { if (ch == null) { return "null"; } String channelInfo = ch.toString() + ", active=" + ch.isActive() + ", open=" + ch.isOpen() + ", registered=" + ch.isRegistered() + ", writable=" + ch.isWritable() + ", id=" + ch.id(); CurrentPassport passport = CurrentPassport.fromChannel(ch); return "Channel: " + channelInfo + ", Passport: " + String.valueOf(passport); } }
@Override protected void run() { for (;;) { Runnable task = takeTask(); if (task != null) { task.run(); updateLastExecutionTime(); } Channel ch = this.ch; if (isShuttingDown()) { if (ch != null) { ch.unsafe().close(ch.unsafe().voidPromise()); } if (confirmShutdown()) { break; } } else { if (ch != null) { // Handle deregistration if (!ch.isRegistered()) { runAllTasks(); deregister(); } } } } }
if (channel.isRegistered()) { channel.close(); } else {