public class ProtocolCodecSession extends DummySession
IoSession
that provides ProtocolEncoderOutput
and ProtocolDecoderOutput
. It is useful for unit-testing
codec and reusing codec for non-network-use (e.g. serialization).
ProtocolCodecSession session = new ProtocolCodecSession(); ProtocolEncoder encoder = ...; MessageX in = ...; encoder.encode(session, in, session.getProtocolEncoderOutput()); IoBuffer buffer = session.getProtocolDecoderOutputQueue().poll();
ProtocolCodecSession session = new ProtocolCodecSession(); ProtocolDecoder decoder = ...; IoBuffer in = ...; decoder.decode(session, in, session.getProtocolDecoderOutput()); Object message = session.getProtocolDecoderOutputQueue().poll();
Constructor and Description |
---|
ProtocolCodecSession()
Creates a new instance.
|
Modifier and Type | Method and Description |
---|---|
ProtocolDecoderOutput |
getDecoderOutput()
Returns the
ProtocolEncoderOutput that buffers
messages generated by ProtocolDecoder . |
java.util.Queue<java.lang.Object> |
getDecoderOutputQueue()
Returns the
Queue of the buffered decoder output. |
ProtocolEncoderOutput |
getEncoderOutput()
|
java.util.Queue<java.lang.Object> |
getEncoderOutputQueue()
Returns the
Queue of the buffered encoder output. |
getConfig, getFilterChain, getHandler, getLocalAddress, getProcessor, getRemoteAddress, getService, getTransportMetadata, setConfig, setHandler, setLocalAddress, setRemoteAddress, setScheduledWriteBytes, setScheduledWriteMessages, setService, setTransportMetadata, updateThroughput
close, close, closeOnFlush, containsAttribute, decreaseReadBufferSize, decreaseScheduledBytesAndMessages, equals, getAttachment, getAttribute, getAttribute, getAttributeKeys, getAttributeMap, getBothIdleCount, getCloseFuture, getCreationTime, getCurrentWriteMessage, getCurrentWriteRequest, getId, getIdleCount, getLastBothIdleTime, getLastIdleTime, getLastIoTime, getLastReaderIdleTime, getLastReadTime, getLastWriterIdleTime, getLastWriteTime, getReadBytes, getReadBytesThroughput, getReaderIdleCount, getReadMessages, getReadMessagesThroughput, getScheduledWriteBytes, getScheduledWriteMessages, getServiceAddress, getTrafficMask, getWriteRequestQueue, getWriterIdleCount, getWrittenBytes, getWrittenBytesThroughput, getWrittenMessages, getWrittenMessagesThroughput, hashCode, increaseIdleCount, increaseReadBufferSize, increaseReadBytes, increaseReadMessages, increaseScheduledWriteBytes, increaseScheduledWriteMessages, increaseWrittenBytes, increaseWrittenMessages, isBothIdle, isClosing, isConnected, isIdle, isReaderIdle, isScheduledForFlush, isWriterIdle, offerClosedReadFuture, offerFailedReadFuture, offerReadFuture, read, removeAttribute, removeAttribute, replaceAttribute, resumeRead, resumeWrite, setAttachment, setAttribute, setAttribute, setAttributeIfAbsent, setAttributeIfAbsent, setAttributeMap, setCurrentWriteRequest, setScheduledForFlush, setTrafficMask, setTrafficMaskNow, setWriteRequestQueue, suspendRead, suspendWrite, toString, updateThroughput, write, write
public ProtocolEncoderOutput getEncoderOutput()
public java.util.Queue<java.lang.Object> getEncoderOutputQueue()
Queue
of the buffered encoder output.public ProtocolDecoderOutput getDecoderOutput()
ProtocolEncoderOutput
that buffers
messages generated by ProtocolDecoder
.public java.util.Queue<java.lang.Object> getDecoderOutputQueue()
Queue
of the buffered decoder output.Copyright © 2004-2019 Apache MINA Project. All Rights Reserved.