Interface ProtocolCodecFactory
- All Known Implementing Classes:
DemuxingProtocolCodecFactory, ObjectSerializationCodecFactory, PrefixedStringCodecFactory, TextLineCodecFactory
public interface ProtocolCodecFactory
Provides
ProtocolEncoder and ProtocolDecoder which translates
binary or protocol specific data into message object and vice versa.
Please refer to
ReverserProtocolProvider
example.
-
Method Summary
Modifier and TypeMethodDescriptiongetDecoder(IoSession session) Returns a new (or reusable) instance ofProtocolDecoderwhich decodes binary or protocol-specific data into message objects.getEncoder(IoSession session) Returns a new (or reusable) instance ofProtocolEncoderwhich encodes message objects into binary or protocol-specific data.
-
Method Details
-
getEncoder
Returns a new (or reusable) instance ofProtocolEncoderwhich encodes message objects into binary or protocol-specific data.- Parameters:
session- The current session- Returns:
- The encoder instance
- Throws:
Exception- If an error occurred while retrieving the encoder
-
getDecoder
Returns a new (or reusable) instance ofProtocolDecoderwhich decodes binary or protocol-specific data into message objects.- Parameters:
session- The current session- Returns:
- The decoder instance
- Throws:
Exception- If an error occurred while retrieving the decoder
-