Package org.apache.mina.filter.codec
Interface ProtocolEncoder
-
- All Known Implementing Classes:
ObjectSerializationEncoder
,ProtocolEncoderAdapter
,SynchronizedProtocolEncoder
,TextLineEncoder
public interface ProtocolEncoder
Encodes higher-level message objects into binary or protocol-specific data. MINA invokesencode(IoSession, Object, ProtocolEncoderOutput)
method with message which is popped from the session write queue, and then the encoder implementation puts encodedByteBuffer
s intoProtocolEncoderOutput
by callingProtocolEncoderOutput.write(ByteBuffer)
.Please refer to
TextLineEncoder
example.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description void
dispose(IoSession session)
Releases all resources related with this encoder.void
encode(IoSession session, java.lang.Object message, ProtocolEncoderOutput out)
Encodes higher-level message objects into binary or protocol-specific data.
-
-
-
Method Detail
-
encode
void encode(IoSession session, java.lang.Object message, ProtocolEncoderOutput out) throws java.lang.Exception
Encodes higher-level message objects into binary or protocol-specific data. MINA invokesencode(IoSession, Object, ProtocolEncoderOutput)
method with message which is popped from the session write queue, and then the encoder implementation puts encodedByteBuffer
s intoProtocolEncoderOutput
.- Throws:
java.lang.Exception
- if the message violated protocol specification
-
dispose
void dispose(IoSession session) throws java.lang.Exception
Releases all resources related with this encoder.- Throws:
java.lang.Exception
- if failed to dispose all resources
-
-