private void removeCloseListener() { if (future != null) { future.removeListener(this); } }
private void cleanup() { promise = null; for (ChannelFuture f : futureList) f.removeListener(this); }
@Override public void call() { future.removeListener(SubscriberToChannelFutureBridge.this); } }));
@Override public boolean remove(Object o) { Channel c = null; if (o instanceof ChannelId) { c = nonServerChannels.remove(o); if (c == null) { c = serverChannels.remove(o); } } else if (o instanceof Channel) { c = (Channel) o; if (c instanceof ServerChannel) { c = serverChannels.remove(c.id()); } else { c = nonServerChannels.remove(c.id()); } } if (c == null) { return false; } c.closeFuture().removeListener(remover); return true; }
@Override public boolean remove(Object o) { Channel c = null; if (o instanceof ChannelId) { c = nonServerChannels.remove(o); if (c == null) { c = serverChannels.remove(o); } } else if (o instanceof Channel) { c = (Channel) o; if (c instanceof ServerChannel) { c = serverChannels.remove(c.id()); } else { c = nonServerChannels.remove(c.id()); } } if (c == null) { return false; } c.closeFuture().removeListener(remover); return true; }
@Override public boolean remove(Object o) { Channel c = null; if (o instanceof ChannelId) { c = nonServerChannels.remove(o); if (c == null) { c = serverChannels.remove(o); } } else if (o instanceof Channel) { c = (Channel) o; if (c instanceof ServerChannel) { c = serverChannels.remove(c.id()); } else { c = nonServerChannels.remove(c.id()); } } if (c == null) { return false; } c.closeFuture().removeListener(remover); return true; }
@Test(timeout = 60000) public void testBridge() throws Exception { rule.subscriber.unsubscribe(); Mockito.verify(rule.future).addListener(rule.bridge); Mockito.verify(rule.future).removeListener(rule.bridge); }
} else { ch.closeFuture().removeListener(closeListener);
@Override public ChannelFuture removeListener(GenericFutureListener<? extends Future<? super Void>> listener) { inputFuture.removeListener(listener); outputFuture.removeListener(listener); return this; }
private void cleanup() { promise = null; for (ChannelFuture f : futureList) f.removeListener(this); }
private void closeConnection(Channel c) { // If we are explicitly closing the connection we don't want to hear // about it. c.closeFuture().removeListener(inProgressCloseListener); c.closeFuture().removeListener(inAvailableCloseListener); c.close(); }
@Override public void onComplete() { if (done.compareAndSet(false, true)) { channel.closeFuture().removeListener(cancelOnCloseListener); post(responseStatus); } } };
@Override public void onError(Throwable t) { if (t == null) { throw new NullPointerException("error is null"); } LOGGER.warn("Exception thrown transmitting stream", t); if (done.compareAndSet(false, true)) { channel.closeFuture().removeListener(cancelOnCloseListener); post(responseStatus); } }
private void cancel() { channel.closeFuture().removeListener(cancelOnCloseListener); if (done.compareAndSet(false, true)) { subscription.cancel(); post(responseStatus); } }
@Override public void removeTerminationListener(GenericFutureListener<? extends Future<? super Void>> listener) { getChannel().closeFuture().removeListener(listener); }
@Override public void add(HttpContent httpContent) { if (state == State.READ) { httpContent.release(); } else { if (httpContent instanceof LastHttpContent) { ctx.channel().closeFuture().removeListener(closeListener); receivedLast = true; } if (listener == null) { addToReceived(httpContent); } else { listener.onContent(httpContent); } } }
@Override public final void dispose() { // Returned value is deliberately ignored f.removeListener(this); if (f.channel() .isActive()) { f.channel() .close(); HttpResources.get() .disposeWhen(bootstrap.config() .localAddress()); } else if (!f.isDone()) { f.cancel(true); } }
@Override @SuppressWarnings("FutureReturnValueIgnored") public final void dispose() { if (isDisposed()) { return; } // Returned value is deliberately ignored f.removeListener(this); if (!f.isDone()) { f.cancel(true); } }
@Override @SuppressWarnings("FutureReturnValueIgnored") public final void dispose() { if (isDisposed()) { return; } // Returned value is deliberately ignored f.removeListener(this); if (!f.isDone()) { f.cancel(true); } }
@Override public final void dispose() { // Returned value is deliberately ignored f.removeListener(this); if (f.channel() .isActive()) { f.channel() .close(); HttpResources.get() .disposeWhen(bootstrap.config() .localAddress()); } else if (!f.isDone()) { f.cancel(true); } }