@Test(dataProvider = "httpEvents") public void httpEventCallbacksCheckDisposal(Callable<AsyncHandler.State> httpEvent) throws Exception { given(emitter.isDisposed()).willReturn(true); final AsyncHandler.State firstState = httpEvent.call(); assertThat(firstState, is(State.ABORT)); then(delegate).should(only()).onThrowable(isA(DisposedException.class)); final AsyncHandler.State secondState = httpEvent.call(); assertThat(secondState, is(State.ABORT)); verifyNoMoreInteractions(delegate); }
@Override public final void onThrowable(Throwable t) { if (delegateTerminated.getAndSet(true)) { return; } Throwable error = t; try { delegate().onThrowable(t); } catch (final Throwable x) { error = new CompositeException(Arrays.asList(t, x)); } emitOnError(error); }
AbstractMaybeAsyncHandlerBridge implements AsyncHandler<Void> { @Override public final void onThrowable(Throwable t) { if (delegateTerminated.getAndSet(true)) { return; } Throwable error = t; try { delegate().onThrowable(t); } catch (final Throwable x) { error = new CompositeException(Arrays.asList(t, x)); } emitOnError(error); } }
AbstractMaybeAsyncHandlerBridge implements AsyncHandler<Void> { @Override public final void onThrowable(Throwable t) { if (delegateTerminated.getAndSet(true)) { return; } Throwable error = t; try { delegate().onThrowable(t); } catch (final Throwable x) { error = new CompositeException(Arrays.asList(t, x)); } emitOnError(error); } protected  AbstractMaybeAsyncHandlerBridge(MaybeEmitter<T> emitter); }
AbstractMaybeAsyncHandlerBridge implements AsyncHandler<Void> { @Override public final void onThrowable(Throwable t) { if (delegateTerminated.getAndSet(true)) { return; } Throwable error = t; try { delegate().onThrowable(t); } catch (final Throwable x) { error = new CompositeException(Arrays.asList(t, x)); } emitOnError(error); } protected  AbstractMaybeAsyncHandlerBridge(MaybeEmitter<T> emitter); @Override final State onBodyPartReceived(HttpResponseBodyPart content); @Override final State onStatusReceived(HttpResponseStatus status); @Override final State onHeadersReceived(HttpHeaders headers); @Override State onTrailingHeadersReceived(HttpHeaders headers); @Override final Void onCompleted(); @Override final void onThrowable(Throwable t); @Override void onHostnameResolutionAttempt(String name); @Override void onHostnameResolutionSuccess(String name, List<InetSocketAddress> addresses); @Override void onHostnameResolutionFailure(String name, Throwable cause); @Override void onTcpConnectAttempt(InetSocketAddress remoteAddress); @Override void onTcpConnectSuccess(InetSocketAddress remoteAddress, Channel connection); @Override void onTcpConnectFailure(InetSocketAddress remoteAddress, Throwable cause); @Override void onTlsHandshakeAttempt(); @Override void onTlsHandshakeSuccess(SSLSession sslSession); @Override void onTlsHandshakeFailure(Throwable cause); @Override void onConnectionPoolAttempt(); @Override void onConnectionPooled(Channel connection); @Override void onConnectionOffer(Channel connection); @Override void onRequestSend(NettyRequest request); @Override void onRetry(); }
AbstractMaybeAsyncHandlerBridge implements AsyncHandler<Void> { @Override public final void onThrowable(Throwable t) { if (delegateTerminated.getAndSet(true)) { return; } Throwable error = t; try { delegate().onThrowable(t); } catch (final Throwable x) { error = new CompositeException(Arrays.asList(t, x)); } emitOnError(error); } protected  AbstractMaybeAsyncHandlerBridge(MaybeEmitter<T> emitter); @Override final State onBodyPartReceived(HttpResponseBodyPart content); @Override final State onStatusReceived(HttpResponseStatus status); @Override final State onHeadersReceived(HttpHeaders headers); @Override State onTrailingHeadersReceived(HttpHeaders headers); @Override final Void onCompleted(); @Override final void onThrowable(Throwable t); @Override void onHostnameResolutionAttempt(String name); @Override void onHostnameResolutionSuccess(String name, List<InetSocketAddress> addresses); @Override void onHostnameResolutionFailure(String name, Throwable cause); @Override void onTcpConnectAttempt(InetSocketAddress remoteAddress); @Override void onTcpConnectSuccess(InetSocketAddress remoteAddress, Channel connection); @Override void onTcpConnectFailure(InetSocketAddress remoteAddress, Throwable cause); @Override void onTlsHandshakeAttempt(); @Override void onTlsHandshakeSuccess(SSLSession sslSession); @Override void onTlsHandshakeFailure(Throwable cause); @Override void onConnectionPoolAttempt(); @Override void onConnectionPooled(Channel connection); @Override void onConnectionOffer(Channel connection); @Override void onRequestSend(NettyRequest request); @Override void onRetry();  }