Prev Class | Next Class | Frames | No Frames |
Summary: Nested | Field | Method | Constr | Detail: Nested | Field | Method | Constr |
java.lang.Object
org.apache.mina.filter.codec.SynchronizedProtocolDecoder
ProtocolDecoder
implementation which decorates an existing decoder
to be thread-safe. Please be careful if you're going to use this decorator
because it can be a root of performance degradation in a multi-thread
environment. Also, by default, appropriate synchronization is done
on a per-session basis by ProtocolCodecFilter
. Please use this
decorator only when you need to synchronize on a per-decoder basis, which
is not common.
Constructor Summary | |
|
Method Summary | |
void |
|
void | |
void |
|
ProtocolDecoder |
|
public SynchronizedProtocolDecoder(ProtocolDecoder decoder)
Creates a new instance which decorates the specified decoder.
public void decode(IoSession session, ByteBuffer in, ProtocolDecoderOutput out) throws Exception
Decodes binary or protocol-specific content into higher-level message objects. MINA invokesProtocolDecoder.decode(IoSession,ByteBuffer,ProtocolDecoderOutput)
method with read data, and then the decoder implementation puts decoded messages intoProtocolDecoderOutput
.
- Specified by:
- decode in interface ProtocolDecoder
public void dispose(IoSession session) throws Exception
Releases all resources related with this decoder.
- Specified by:
- dispose in interface ProtocolDecoder
public void finishDecode(IoSession session, ProtocolDecoderOutput out) throws Exception
Invoked when the specified session is closed. This method is useful when you deal with the protocol which doesn't specify the length of a message such as HTTP response without content-length header. Implement this method to process the remaining data thatProtocolDecoder.decode(IoSession,ByteBuffer,ProtocolDecoderOutput)
method didn't process completely.
- Specified by:
- finishDecode in interface ProtocolDecoder