|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.mina.filter.codec.statemachine.DecodingStateProtocolDecoder
public class DecodingStateProtocolDecoder
ProtocolDecoder
which uses a DecodingState
to decode data.
Use a DecodingStateMachine
as DecodingState
to create
a state machine which can decode your protocol.
NOTE: This is a stateful decoder. You should create one instance per session.
Constructor Summary | |
---|---|
DecodingStateProtocolDecoder(DecodingState state)
Creates a new instance using the specified DecodingState
instance. |
Method Summary | |
---|---|
void |
decode(IoSession session,
IoBuffer in,
ProtocolDecoderOutput out)
Decodes binary or protocol-specific content into higher-level message objects. |
void |
dispose(IoSession session)
Releases all resources related with this decoder. |
void |
finishDecode(IoSession session,
ProtocolDecoderOutput out)
Invoked when the specified session is closed. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public DecodingStateProtocolDecoder(DecodingState state)
DecodingState
instance.
state
- the DecodingState
.
java.lang.NullPointerException
- if the specified state is null
.Method Detail |
---|
public void decode(IoSession session, IoBuffer in, ProtocolDecoderOutput out) throws java.lang.Exception
ProtocolDecoder.decode(IoSession, IoBuffer, ProtocolDecoderOutput)
method with read data, and then the decoder implementation puts decoded
messages into ProtocolDecoderOutput
.
decode
in interface ProtocolDecoder
java.lang.Exception
- if the read data violated protocol specificationpublic void finishDecode(IoSession session, ProtocolDecoderOutput out) throws java.lang.Exception
ProtocolDecoder.decode(IoSession, IoBuffer, ProtocolDecoderOutput)
method didn't process completely.
finishDecode
in interface ProtocolDecoder
java.lang.Exception
- if the read data violated protocol specificationpublic void dispose(IoSession session) throws java.lang.Exception
dispose
in interface ProtocolDecoder
java.lang.Exception
- if failed to dispose all resources
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |