Prev Class | Next Class | Frames | No Frames |
Summary: Nested | Field | Method | Constr | Detail: Nested | Field | Method | Constr |
java.lang.Object
org.apache.mina.filter.codec.demux.DemuxingProtocolCodecFactory
ProtocolCodecFactory
that consists of multiple
MessageEncoder
s and MessageDecoder
s.
ProtocolEncoder
and ProtocolDecoder
this factory
returns demultiplex incoming messages and buffers to
appropriate MessageEncoder
s and MessageDecoder
s.
MessageEncoder
and MessageDecoder
MessageEncoder
and MessageDecoder
to put all
resources that need to be released as a session attribute. disposeCodecResources(IoSession)
method will be invoked when a session is closed. Override disposeCodecResources(IoSession)
to release the resources you've put as an attribute.
We didn't provide any dispose method for MessageEncoder
and MessageDecoder
because they can give you a big performance penalty in case you have a lot of
message types to handle.
MessageEncoder
, MessageDecoder
Constructor Summary | |
Method Summary | |
protected void |
|
ProtocolDecoder |
|
ProtocolEncoder |
|
void |
|
void |
|
void |
|
void |
|
void |
|
protected void disposeCodecResources(IoSession session)
Implement this method to release all resources acquired to perform encoding and decoding messages for the specified session. By default, this method does nothing.
- Parameters:
session
- the session that requires resource deallocation now
public ProtocolDecoder getDecoder() throws Exception
Returns a new (or reusable) instance ofProtocolDecoder
which decodes binary or protocol-specific data into message objects.
- Specified by:
- getDecoder in interface ProtocolCodecFactory
public ProtocolEncoder getEncoder() throws Exception
Returns a new (or reusable) instance ofProtocolEncoder
which encodes message objects into binary or protocol-specific data.
- Specified by:
- getEncoder in interface ProtocolCodecFactory
public void register(Class> encoderOrDecoderClass)