|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.mina.core.session.AbstractIoSession
org.apache.mina.core.session.DummySession
org.apache.mina.filter.codec.ProtocolCodecSession
public class ProtocolCodecSession
A virtual 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 Summary | |
---|---|
ProtocolCodecSession()
Creates a new instance. |
Method Summary | |
---|---|
ProtocolDecoderOutput |
getDecoderOutput()
Returns the ProtocolEncoderOutput that buffers
messages generated by ProtocolDecoder . |
Queue<Object> |
getDecoderOutputQueue()
Returns the Queue of the buffered decoder output. |
ProtocolEncoderOutput |
getEncoderOutput()
Returns the ProtocolEncoderOutput that buffers
IoBuffer s generated by ProtocolEncoder . |
Queue<Object> |
getEncoderOutputQueue()
Returns the Queue of the buffered encoder output. |
Methods inherited from class org.apache.mina.core.session.DummySession |
---|
getConfig, getFilterChain, getHandler, getLocalAddress, getProcessor, getRemoteAddress, getService, getTransportMetadata, setConfig, setHandler, setLocalAddress, setRemoteAddress, setScheduledWriteBytes, setScheduledWriteMessages, setService, setTransportMetadata, updateThroughput |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public ProtocolCodecSession()
Method Detail |
---|
public ProtocolEncoderOutput getEncoderOutput()
ProtocolEncoderOutput
that buffers
IoBuffer
s generated by ProtocolEncoder
.
public Queue<Object> getEncoderOutputQueue()
Queue
of the buffered encoder output.
public ProtocolDecoderOutput getDecoderOutput()
ProtocolEncoderOutput
that buffers
messages generated by ProtocolDecoder
.
public Queue<Object> getDecoderOutputQueue()
Queue
of the buffered decoder output.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |