@Override public void handleClose(final Channel closed, final IOException exception) { channelAssociation.handleChannelClosed(closed, exception); } });
@Override public void handleClose(final Channel closed, final IOException exception) { closeable.channelAssociation.handleChannelClosed(closed, exception); } });
@Override public void handleClose(final Channel old, final IOException e) { synchronized (ChannelStrategy.this) { if(ChannelStrategy.this.channel == old) { ChannelStrategy.this.channel = null; } } handler.handleChannelClosed(old, e); } });
@Override public void handleClose(final Channel old, final IOException e) { synchronized (ChannelStrategy.this) { if(ChannelStrategy.this.channel == old) { ChannelStrategy.this.handler.handleClose(old, e); ChannelStrategy.this.channel = null; } } handler.handleChannelClosed(old, e); } });
@Override public void handleClose(final Channel closed, final IOException exception) { if(CLIModelControllerClient.this.state.get() == CLOSED) { return; } if(CLIModelControllerClient.this.state.compareAndSet(CONNECTING, LOST_CONNECTION)) { return; } synchronized(lock) { if (strategy != null) { if(strategy != originalStrategy) { new Exception("Channel close handler " + strategy + " " + originalStrategy).printStackTrace(); } strategy = null; closeHandler.handleClose(); } channelAssociation.handleChannelClosed(closed, exception); lock.notifyAll(); } // Closing the strategy in this handler may result in race conditions // with connection closing and then deadlocks in remoting // it's safer to close the strategy from the connection close handler closed.getConnection().addCloseHandler(new CloseHandler<Connection>(){ @Override public void handleClose(Connection closed, IOException exception) { StreamUtils.safeClose(originalStrategy); }}); } }
@Override public void handleClose(final Channel closed, final IOException exception) { if(CLIModelControllerClient.this.state.get() == CLOSED) { return; } if(CLIModelControllerClient.this.state.compareAndSet(CONNECTING, LOST_CONNECTION)) { return; } synchronized(lock) { if (strategy != null) { if(strategy != originalStrategy) { new Exception("Channel close handler " + strategy + " " + originalStrategy).printStackTrace(); } strategy = null; closeHandler.handleClose(); } channelAssociation.handleChannelClosed(closed, exception); lock.notifyAll(); } // Closing the strategy in this handler may result in race conditions // with connection closing and then deadlocks in remoting // it's safer to close the strategy from the connection close handler closed.getConnection().addCloseHandler(new CloseHandler<Connection>(){ @Override public void handleClose(Connection closed, IOException exception) { StreamUtils.safeClose(originalStrategy); }}); } }