Package org.apache.mina.filter.codec
Interface ProtocolEncoder
-
- All Known Implementing Classes:
DemuxingProtocolEncoder,LdapProtocolEncoder,ObjectSerializationEncoder,PrefixedStringEncoder,ProtocolEncoderAdapter,SynchronizedProtocolEncoder,TextLineEncoder
public interface ProtocolEncoderEncodes 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 (typicallyIoBuffers) intoProtocolEncoderOutputby callingProtocolEncoderOutput.write(Object).Please refer to
TextLineEncoderexample.- Author:
- Apache MINA Project
- See Also:
ProtocolEncoderException
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description voiddispose(IoSession session)Releases all resources related with this encoder.voidencode(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 (typicallyIoBuffers) intoProtocolEncoderOutput.- Parameters:
session- The current Sessionmessage- the message to encodeout- TheProtocolEncoderOutputthat will receive the encoded message- Throws:
Exception- if the message violated protocol specification
-
-