public void completed(final IOSession session) { Args.notNull(session, "Session"); if (this.completed) { return; } this.completed = true; synchronized (this) { this.session = session; if (this.callback != null) { this.callback.completed(this); } notifyAll(); } }
public void failed(final IOException exception) { if (exception == null) { return; } if (this.completed) { return; } this.completed = true; final SelectionKey key = this.key; if (key != null) { key.cancel(); final Channel channel = key.channel(); try { channel.close(); } catch (final IOException ignore) {} } synchronized (this) { this.exception = exception; if (this.callback != null) { this.callback.failed(this); } notifyAll(); } }
public void timeout() { if (this.completed) { return; } this.completed = true; final SelectionKey key = this.key; if (key != null) { key.cancel(); final Channel channel = key.channel(); if (channel.isOpen()) { try { channel.close(); } catch (final IOException ignore) {} } } synchronized (this) { if (this.callback != null) { this.callback.timeout(this); } } }
@Override public void cancel() { if (this.completed) { return; } this.completed = true; final SelectionKey key = this.key; if (key != null) { key.cancel(); final Channel channel = key.channel(); if (channel.isOpen()) { try { channel.close(); } catch (final IOException ignore) {} } } synchronized (this) { if (this.callback != null) { this.callback.cancelled(this); } notifyAll(); } }
public void timeout() { if (this.completed) { return; } this.completed = true; final SelectionKey key = this.key; if (key != null) { key.cancel(); final Channel channel = key.channel(); if (channel.isOpen()) { try { channel.close(); } catch (final IOException ignore) {} } } synchronized (this) { if (this.callback != null) { this.callback.timeout(this); } } }
@Override public void cancel() { if (this.completed) { return; } this.completed = true; final SelectionKey key = this.key; if (key != null) { key.cancel(); final Channel channel = key.channel(); if (channel.isOpen()) { try { channel.close(); } catch (final IOException ignore) {} } } synchronized (this) { if (this.callback != null) { this.callback.cancelled(this); } notifyAll(); } }
public void completed(final IOSession session) { Args.notNull(session, "Session"); if (this.completed) { return; } this.completed = true; synchronized (this) { this.session = session; if (this.callback != null) { this.callback.completed(this); } notifyAll(); } }
public void failed(final IOException exception) { if (exception == null) { return; } if (this.completed) { return; } this.completed = true; final SelectionKey key = this.key; if (key != null) { key.cancel(); final Channel channel = key.channel(); try { channel.close(); } catch (final IOException ignore) {} } synchronized (this) { this.exception = exception; if (this.callback != null) { this.callback.failed(this); } notifyAll(); } }