Package org.apache.mina.filter.codec
Interface ProtocolEncoder
-
- All Known Implementing Classes:
DemuxingProtocolEncoder
,ObjectSerializationEncoder
,PrefixedStringEncoder
,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 encoded messages (typicallyIoBuffer
s) intoProtocolEncoderOutput
by callingProtocolEncoderOutput.write(Object)
.Please refer to
TextLineEncoder
example.- Author:
- Apache MINA Project
- See Also:
ProtocolEncoderException
-
-
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, Object message, ProtocolEncoderOutput out)
Encodes higher-level message objects into binary or protocol-specific data.
-
-
-
Method Detail
-
encode
void encode(IoSession session, Object message, ProtocolEncoderOutput out) throws 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 encoded messages (typicallyIoBuffer
s) intoProtocolEncoderOutput
.- Parameters:
session
- The current Sessionmessage
- the message to encodeout
- TheProtocolEncoderOutput
that will receive the encoded message- Throws:
Exception
- if the message violated protocol specification
-
-