@Override public void handleEvent(StreamConnection channel) { try { for (CloseListener l : closeListeners) { try { l.closed(AbstractServerConnection.this); } catch (Throwable e) { UndertowLogger.REQUEST_LOGGER.exceptionInvokingCloseListener(l, e); } } if (current != null) { current.endExchange(); } ChannelListeners.invokeChannelListener(AbstractServerConnection.this, listener); } finally { if(extraBytes != null) { extraBytes.close(); extraBytes = null; } } } }
@Override public void handleEvent(StreamConnection channel) { try { for (CloseListener l : closeListeners) { try { l.closed(AbstractServerConnection.this); } catch (Throwable e) { UndertowLogger.REQUEST_LOGGER.exceptionInvokingCloseListener(l, e); } } if (current != null) { current.endExchange(); } ChannelListeners.invokeChannelListener(AbstractServerConnection.this, listener); } finally { if(extraBytes != null) { extraBytes.close(); extraBytes = null; } } } }
@Override public void handleEvent(StreamConnection channel) { try { for (CloseListener l : closeListeners) { try { l.closed(AbstractServerConnection.this); } catch (Throwable e) { UndertowLogger.REQUEST_LOGGER.exceptionInvokingCloseListener(l, e); } } if (current != null) { current.endExchange(); } ChannelListeners.invokeChannelListener(AbstractServerConnection.this, listener); } finally { if(extraBytes != null) { extraBytes.close(); extraBytes = null; } } } }
@Override public ConduitStreamSinkChannel getSinkChannel() { ConduitStreamSinkChannel sinkChannel = new ConduitStreamSinkChannel( Configurable.EMPTY, new BufferedStreamSinkConduit( new NullStreamSinkConduit(worker.getIoThread()), new PooledAdaptor(bufferPool.allocate()) ) ); sinkChannel.setCloseListener(conduitStreamSinkChannel -> { for (CloseListener l : closeListeners) { try { l.closed(InVMConnection.this); } catch (Throwable e) { UndertowLogger.REQUEST_LOGGER.exceptionInvokingCloseListener(l, e); } } }); return sinkChannel; }
@Override public ConduitStreamSinkChannel getSinkChannel() { ConduitStreamSinkChannel sinkChannel = new ConduitStreamSinkChannel( Configurable.EMPTY, new BufferedStreamSinkConduit( new NullStreamSinkConduit(worker.getIoThread()), new PooledAdaptor(bufferPool.allocate()) ) ); sinkChannel.setCloseListener(conduitStreamSinkChannel -> { for (CloseListener l : closeListeners) { try { l.closed(InVMConnection.this); } catch (Throwable e) { UndertowLogger.REQUEST_LOGGER.exceptionInvokingCloseListener(l, e); } } }); return sinkChannel; }