org.apache.mina.filter.codec.demux

## Class DemuxingProtocolCodecFactory

- java.lang.Object
- - org.apache.mina.filter.codec.demux.DemuxingProtocolCodecFactory

- All Implemented Interfaces:
    ProtocolCodecFactory
  Direct Known Subclasses:
    SumUpProtocolCodecFactory

      public class DemuxingProtocolCodecFactory
      extends Object
      implements ProtocolCodecFactory

  A convenience `ProtocolCodecFactory` that provides `DemuxingProtocolEncoder` and `DemuxingProtocolDecoder` as a pair.

  `DemuxingProtocolEncoder` and `DemuxingProtocolDecoder` demultiplex incoming messages and buffers to appropriate `MessageEncoder`s and `MessageDecoder`s.

  Author:
    Apache MINA Project

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `DemuxingProtocolCodecFactory()`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `addMessageDecoder(Class<? extends MessageDecoder> decoderClass)`
    `void` | `addMessageDecoder(MessageDecoder decoder)`
    `void` | `addMessageDecoder(MessageDecoderFactory factory)`
    `void` | `addMessageEncoder(Class<?> messageType, Class<? extends MessageEncoder> encoderClass)`
    `<T> void` | `addMessageEncoder(Class<T> messageType, MessageEncoder<? super T> encoder)`
    `<T> void` | `addMessageEncoder(Class<T> messageType, MessageEncoderFactory<? super T> factory)`
    `void` | `addMessageEncoder(Iterable<Class<?>> messageTypes, Class<? extends MessageEncoder> encoderClass)`
    `<T> void` | `addMessageEncoder(Iterable<Class<? extends T>> messageTypes, MessageEncoder<? super T> encoder)`
    `<T> void` | `addMessageEncoder(Iterable<Class<? extends T>> messageTypes, MessageEncoderFactory<? super T> factory)`
    `ProtocolDecoder` | `getDecoder(IoSession session)` Returns a new (or reusable) instance of `ProtocolDecoder` which decodes binary or protocol-specific data into message objects.
    `ProtocolEncoder` | `getEncoder(IoSession session)` Returns a new (or reusable) instance of `ProtocolEncoder` which encodes message objects into binary or protocol-specific data.

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### DemuxingProtocolCodecFactory

          public DemuxingProtocolCodecFactory()

  - ### Method Detail

    - #### getEncoder

          public ProtocolEncoder getEncoder(IoSession session)
                                     throws Exception

      Returns a new (or reusable) instance of `ProtocolEncoder` which encodes message objects into binary or protocol-specific data.
      Specified by:
        `getEncoder` in interface `ProtocolCodecFactory`
      Throws:
        `Exception`

    - #### getDecoder

          public ProtocolDecoder getDecoder(IoSession session)
                                     throws Exception

      Returns a new (or reusable) instance of `ProtocolDecoder` which decodes binary or protocol-specific data into message objects.
      Specified by:
        `getDecoder` in interface `ProtocolCodecFactory`
      Throws:
        `Exception`

    - #### addMessageEncoder

          public void addMessageEncoder(Class<?> messageType,
                               Class<? extends MessageEncoder> encoderClass)

    - #### addMessageEncoder

          public <T> void addMessageEncoder(Class<T> messageType,
                                   MessageEncoder<? super T> encoder)

    - #### addMessageEncoder

          public <T> void addMessageEncoder(Class<T> messageType,
                                   MessageEncoderFactory<? super T> factory)

    - #### addMessageEncoder

          public void addMessageEncoder(Iterable<Class<?>> messageTypes,
                               Class<? extends MessageEncoder> encoderClass)

    - #### addMessageEncoder

          public <T> void addMessageEncoder(Iterable<Class<? extends T>> messageTypes,
                                   MessageEncoder<? super T> encoder)

    - #### addMessageEncoder

          public <T> void addMessageEncoder(Iterable<Class<? extends T>> messageTypes,
                                   MessageEncoderFactory<? super T> factory)

    - #### addMessageDecoder

          public void addMessageDecoder(Class<? extends MessageDecoder> decoderClass)

    - #### addMessageDecoder

          public void addMessageDecoder(MessageDecoder decoder)

    - #### addMessageDecoder

          public void addMessageDecoder(MessageDecoderFactory factory)

Copyright © 2004-2012 Apache MINA Project. All Rights Reserved.