@Override public void channelInactive(ChannelHandlerContext ctx) throws Exception { try { requestHandler.channelInactive(); } catch (RuntimeException e) { logger.error("Exception from request handler while channel is inactive", e); } try { responseHandler.channelInactive(); } catch (RuntimeException e) { logger.error("Exception from response handler while channel is inactive", e); } super.channelInactive(ctx); }
@Override public void channelInactive(ChannelHandlerContext ctx) throws Exception { try { requestHandler.channelInactive(); } catch (RuntimeException e) { logger.error("Exception from request handler while channel is inactive", e); } try { responseHandler.channelInactive(); } catch (RuntimeException e) { logger.error("Exception from response handler while channel is inactive", e); } super.channelInactive(ctx); }
@Override public void channelInactive(ChannelHandlerContext ctx) throws Exception { try { requestHandler.channelInactive(); } catch (RuntimeException e) { logger.error("Exception from request handler while channel is inactive", e); } try { responseHandler.channelInactive(); } catch (RuntimeException e) { logger.error("Exception from response handler while channel is inactive", e); } super.channelInactive(ctx); }
@Override public void channelInactive(ChannelHandlerContext ctx) throws Exception { try { requestHandler.channelInactive(); } catch (RuntimeException e) { logger.error("Exception from request handler while channel is inactive", e); } try { responseHandler.channelInactive(); } catch (RuntimeException e) { logger.error("Exception from response handler while channel is inactive", e); } super.channelInactive(ctx); }
@Test public void failOutstandingStreamCallbackOnClose() throws Exception { Channel c = new LocalChannel(); c.pipeline().addLast(TransportFrameDecoder.HANDLER_NAME, new TransportFrameDecoder()); TransportResponseHandler handler = new TransportResponseHandler(c); StreamCallback cb = mock(StreamCallback.class); handler.addStreamCallback("stream-1", cb); handler.channelInactive(); verify(cb).onFailure(eq("stream-1"), isA(IOException.class)); }
@Test public void failOutstandingStreamCallbackOnClose() throws Exception { Channel c = new LocalChannel(); c.pipeline().addLast(TransportFrameDecoder.HANDLER_NAME, new TransportFrameDecoder()); TransportResponseHandler handler = new TransportResponseHandler(c); StreamCallback cb = mock(StreamCallback.class); handler.addStreamCallback("stream-1", cb); handler.channelInactive(); verify(cb).onFailure(eq("stream-1"), isA(IOException.class)); }