org.littleshoot.util.mina
Interface DemuxableProtocolCodecFactory<T>

Type Parameters:
T - The type that the created encoders are designed to encode.

public interface DemuxableProtocolCodecFactory<T>

ProtocolCodecFactory for protocols that can be demultiplexed.


Method Summary
 boolean canDecode(org.littleshoot.mina.common.ByteBuffer in)
          Determines whether or not this codec factory is capable of decoding the specified data.
 boolean enoughData(org.littleshoot.mina.common.ByteBuffer in)
          Returns whether or not the specified buffer has enough data to determine whether or not this decoder can handle it.
 Class<T> getClassToEncode()
          Gets the class this factory is designed to encode.
 DemuxableProtocolDecoder newDecoder()
          Returns a new (or reusable) instance of ProtocolDecoder which decodes binary or protocol-specific data into message objects.
 org.littleshoot.mina.filter.codec.ProtocolEncoder newEncoder()
          Creates a new encoder.
 

Method Detail

newEncoder

org.littleshoot.mina.filter.codec.ProtocolEncoder newEncoder()
Creates a new encoder.

Returns:
A new ProtocolEncoder.

newDecoder

DemuxableProtocolDecoder newDecoder()
Returns a new (or reusable) instance of ProtocolDecoder which decodes binary or protocol-specific data into message objects.

Returns:
A new DemuxableProtocolDecoder for decoding a particular protocol.

getClassToEncode

Class<T> getClassToEncode()
Gets the class this factory is designed to encode.

Returns:
The Class this factory is designed to encode.

canDecode

boolean canDecode(org.littleshoot.mina.common.ByteBuffer in)
Determines whether or not this codec factory is capable of decoding the specified data.

Parameters:
in - The data to decode.
Returns:
true if this decoder can decode the data, otherwise false.

enoughData

boolean enoughData(org.littleshoot.mina.common.ByteBuffer in)
Returns whether or not the specified buffer has enough data to determine whether or not this decoder can handle it.

Parameters:
in - The incoming buffer of data.
Returns:
true if there's enough data available to determine whether or not this decoder can understand the data.


Copyright © 2013 LittleShoot. All Rights Reserved.