Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.apache.mina.filter.codec
Class ProtocolCodecFilter

    java.lang.Object
      org.apache.mina.common.IoFilterAdapter
          org.apache.mina.filter.codec.ProtocolCodecFilter

All Implemented Interfaces:
  IoFilter

    public class ProtocolCodecFilter

extends IoFilterAdapter

An `IoFilter` which translates binary or protocol specific data into message object and vice versa using `ProtocolCodecFactory`, `ProtocolEncoder`, or `ProtocolDecoder`.

Version:
  $Rev: 612026 $, $Date: 2008-01-15 15:16:14 +0900 (Tue, 15 Jan 2008) $
Author:
  The Apache Directory Project (mina-dev@directory.apache.org)

Nested Class Summary

Nested classes/interfaces inherited from interface org.apache.mina.common.IoFilter
`IoFilter.NextFilter, IoFilter.WriteRequest`

Field Summary
`static String` | `DECODER`
`static String` | `ENCODER`

Constructor Summary
`ProtocolCodecFilter(Class<? extends ProtocolEncoder> encoderClass, Class<? extends ProtocolDecoder> decoderClass)`
`ProtocolCodecFilter(ProtocolCodecFactory factory)`
`ProtocolCodecFilter(ProtocolEncoder encoder, ProtocolDecoder decoder)`

Method Summary
`void` | `filterWrite(IoFilter.NextFilter nextFilter, IoSession session, IoFilter.WriteRequest writeRequest)` Filters `IoSession.write(Object)` method invocation.
`void` | `messageReceived(IoFilter.NextFilter nextFilter, IoSession session, Object message)` Filters `IoHandler.messageReceived(IoSession,Object)` event.
`void` | `messageSent(IoFilter.NextFilter nextFilter, IoSession session, Object message)` Filters `IoHandler.messageSent(IoSession,Object)` event.
`void` | `onPostRemove(IoFilterChain parent, String name, IoFilter.NextFilter nextFilter)` Invoked after this filter is removed from the specified `parent`.
`void` | `onPreAdd(IoFilterChain parent, String name, IoFilter.NextFilter nextFilter)` Invoked before this filter is added to the specified `parent`.
`void` | `sessionClosed(IoFilter.NextFilter nextFilter, IoSession session)` Filters `IoHandler.sessionClosed(IoSession)` event.

Methods inherited from class org.apache.mina.common.IoFilterAdapter
`destroy, exceptionCaught, filterClose, init, onPostAdd, onPreRemove, sessionCreated, sessionIdle, sessionOpened`

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Field Detail

### ENCODER

    public static final String ENCODER

### DECODER

    public static final String DECODER

Constructor Detail

### ProtocolCodecFilter

    public ProtocolCodecFilter(ProtocolCodecFactory factory)

### ProtocolCodecFilter

    public ProtocolCodecFilter(ProtocolEncoder encoder,
                               ProtocolDecoder decoder)

### ProtocolCodecFilter

    public ProtocolCodecFilter(Class<? extends ProtocolEncoder> encoderClass,
                               Class<? extends ProtocolDecoder> decoderClass)

Method Detail

### onPreAdd

    public void onPreAdd(IoFilterChain parent,
                         String name,
                         IoFilter.NextFilter nextFilter)
                  throws Exception

  Description copied from interface: `IoFilter`
  Invoked before this filter is added to the specified `parent`. Please note that this method can be invoked more than once if this filter is added to more than one parents. This method is not invoked before `IoFilter.init()` is invoked.

  Specified by:
    `onPreAdd` in interface `IoFilter`
  Overrides:
    `onPreAdd` in class `IoFilterAdapter`
  Parameters:
    `parent` - the parent who called this method
    `name` - the name assigned to this filter
    `nextFilter` - the `IoFilter.NextFilter` for this filter. You can reuse this object until this filter is removed from the chain.
  Throws:
    `Exception`

### onPostRemove

    public void onPostRemove(IoFilterChain parent,
                             String name,
                             IoFilter.NextFilter nextFilter)
                      throws Exception

  Description copied from interface: `IoFilter`
  Invoked after this filter is removed from the specified `parent`. Please note that this method can be invoked more than once if this filter is removed from more than one parents. This method is always invoked before `IoFilter.destroy()` is invoked.

  Specified by:
    `onPostRemove` in interface `IoFilter`
  Overrides:
    `onPostRemove` in class `IoFilterAdapter`
  Parameters:
    `parent` - the parent who called this method
    `name` - the name assigned to this filter
    `nextFilter` - the `IoFilter.NextFilter` for this filter. You can reuse this object until this filter is removed from the chain.
  Throws:
    `Exception`

### messageReceived

    public void messageReceived(IoFilter.NextFilter nextFilter,
                                IoSession session,
                                Object message)
                         throws Exception

  Description copied from interface: `IoFilter`
  Filters `IoHandler.messageReceived(IoSession,Object)` event.

  Specified by:
    `messageReceived` in interface `IoFilter`
  Overrides:
    `messageReceived` in class `IoFilterAdapter`
  Throws:
    `Exception`

### messageSent

    public void messageSent(IoFilter.NextFilter nextFilter,
                            IoSession session,
                            Object message)
                     throws Exception

  Description copied from interface: `IoFilter`
  Filters `IoHandler.messageSent(IoSession,Object)` event.

  Specified by:
    `messageSent` in interface `IoFilter`
  Overrides:
    `messageSent` in class `IoFilterAdapter`
  Throws:
    `Exception`

### filterWrite

    public void filterWrite(IoFilter.NextFilter nextFilter,
                            IoSession session,
                            IoFilter.WriteRequest writeRequest)
                     throws Exception

  Description copied from interface: `IoFilter`
  Filters `IoSession.write(Object)` method invocation.

  Specified by:
    `filterWrite` in interface `IoFilter`
  Overrides:
    `filterWrite` in class `IoFilterAdapter`
  Throws:
    `Exception`

### sessionClosed

    public void sessionClosed(IoFilter.NextFilter nextFilter,
                              IoSession session)
                       throws Exception

  Description copied from interface: `IoFilter`
  Filters `IoHandler.sessionClosed(IoSession)` event.

  Specified by:
    `sessionClosed` in interface `IoFilter`
  Overrides:
    `sessionClosed` in class `IoFilterAdapter`
  Throws:
    `Exception`

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

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