AbstractIoSession implements IoSession, ReadFilterChainController, WriteFilterChainController { public void processSessionClosed() { if (IS_DEBUG) { LOG.debug("processing session closed event"); } try { for (IoFilter filter : chain) { filter.sessionClosed(this); } IoHandler handler = getService().getIoHandler(); if (handler != null) { IoHandlerExecutor executor = getService().getIoHandlerExecutor(); if (executor != null) { executor.execute(new CloseEvent(this)); } else { handler.sessionClosed(this); } } } catch (RuntimeException e) { LOG.error("Exception while closing the session : ", e); } service.getManagedSessions().remove(id); } AbstractIoSession(IoService service, IdleChecker idleChecker); @Override boolean isClosed(); @Override boolean isClosing(); @Override boolean isConnected(); @Override boolean isCreated(); @Override boolean isSecuring(); @Override boolean isConnectedSecured(); @Override void changeState(SessionState to); @Override boolean isSecured(); @Override void initSecure(SSLContext sslContext); @Override long getId(); @Override long getCreationTime(); @Override long getReadBytes(); void incrementWrittenBytes(int bytesCount); @Override long getWrittenBytes(); @Override long getLastReadTime(); @Override long getLastWriteTime(); @Override final long getLastIoTime(); @Override IoService getService(); @Override final T getAttribute(AttributeKey<T> key, T defaultValue); @Override final T getAttribute(AttributeKey<T> key); @Override final T setAttribute(AttributeKey<? extends T> key, T value); @Override Set<AttributeKey<?>> getAttributeKeys(); @Override T removeAttribute(AttributeKey<T> key); @Override void write(Object message); @Override IoFuture<Void> writeWithFuture(Object message); void processSessionOpen(); void processSessionClosed(); void processSessionIdle(IdleStatus status); void processMessageReceived(ByteBuffer message); void processMessageWriting(WriteRequest writeRequest, IoFuture<Void> future); void processMessageSent(Object highLevelMessage); void processHandshakeStarted(); void processHandshakeCompleted(); void processSecureClosed(); @Override void callWriteNextFilter(WriteRequest message); @Override void callWriteMessageForRead(Object message); @Override void callReadNextFilter(Object message); @Override String toString();  }
@Test public void chain_close() { final DummySession session = new DummySession(service); session.processSessionClosed(); verify(filter1).sessionClosed(eq(session)); verify(filter2).sessionClosed(eq(session)); verify(filter3).sessionClosed(eq(session)); }