@Test public void chain_writes() { final DummySession session = new DummySession(service); final WriteRequest buffer = mock(DefaultWriteRequest.class); session.processMessageWriting(buffer, null); verify(filter1).messageWriting(eq(session), eq(buffer), any(WriteFilterChainController.class)); verify(filter2).messageWriting(eq(session), eq(buffer), any(WriteFilterChainController.class)); verify(filter3).messageWriting(eq(session), eq(buffer), any(WriteFilterChainController.class)); }
public void processMessageWriting(WriteRequest writeRequest, IoFuture<Void> future) { if (IS_DEBUG) { LOG.debug("processing message '{}' writing event for session {}", writeRequest, this); } try { if (chain.length < 1) { enqueueWriteRequest(writeRequest); } else { writeChainPosition = chain.length - 1; int position = writeChainPosition; IoFilter nextFilter = chain[position]; nextFilter.messageWriting(this, writeRequest, this); } if (future != null) { writeRequest.setFuture(future); } } catch (RuntimeException e) { processException(e); } }
AbstractIoSession implements IoSession, ReadFilterChainController, WriteFilterChainController { public void processMessageWriting(WriteRequest writeRequest, IoFuture<Void> future) { if (IS_DEBUG) { LOG.debug("processing message '{}' writing event for session {}", writeRequest, this); } try { if (chain.length < 1) { enqueueWriteRequest(writeRequest); } else { writeChainPosition = chain.length - 1; int position = writeChainPosition; IoFilter nextFilter = chain[position]; nextFilter.messageWriting(this, writeRequest, this); } if (future != null) { writeRequest.setFuture(future); } } catch (RuntimeException e) { processException(e); } } }
AbstractIoSession implements IoSession, ReadFilterChainController, WriteFilterChainController { public void processMessageWriting(WriteRequest writeRequest, IoFuture<Void> future) { if (IS_DEBUG) { LOG.debug("processing message '{}' writing event for session {}", writeRequest, this); } try { if (chain.length < 1) { enqueueWriteRequest(writeRequest); } else { writeChainPosition = chain.length - 1; int position = writeChainPosition; IoFilter nextFilter = chain[position]; nextFilter.messageWriting(this, writeRequest, this); } if (future != null) { writeRequest.setFuture(future); } } catch (RuntimeException e) { processException(e); } } AbstractIoSession(IoService service, IdleChecker idleChecker); }
AbstractIoSession implements IoSession, ReadFilterChainController, WriteFilterChainController { public void processMessageWriting(WriteRequest writeRequest, IoFuture<Void> future) { if (IS_DEBUG) { LOG.debug("processing message '{}' writing event for session {}", writeRequest, this); } try { if (chain.length < 1) { enqueueWriteRequest(writeRequest); } else { writeChainPosition = chain.length - 1; int position = writeChainPosition; IoFilter nextFilter = chain[position]; nextFilter.messageWriting(this, writeRequest, this); } if (future != null) { writeRequest.setFuture(future); } } catch (RuntimeException e) { processException(e); } } 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(); }
AbstractIoSession implements IoSession, ReadFilterChainController, WriteFilterChainController { public void processMessageWriting(WriteRequest writeRequest, IoFuture<Void> future) { if (IS_DEBUG) { LOG.debug("processing message '{}' writing event for session {}", writeRequest, this); } try { if (chain.length < 1) { enqueueWriteRequest(writeRequest); } else { writeChainPosition = chain.length - 1; int position = writeChainPosition; IoFilter nextFilter = chain[position]; nextFilter.messageWriting(this, writeRequest, this); } if (future != null) { writeRequest.setFuture(future); } } catch (RuntimeException e) { processException(e); } } 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();  }