org.apache.mina.filter.util

## Class CommonEventFilter

- java.lang.Object
- - org.apache.mina.core.filterchain.IoFilterAdapter
  - - org.apache.mina.filter.util.CommonEventFilter

- All Implemented Interfaces:
    IoFilter
  Direct Known Subclasses:
    MdcInjectionFilter

      public abstract class CommonEventFilter
      extends IoFilterAdapter

  Extend this class when you want to create a filter that wraps the same logic around all 9 IoEvents
  Author:
    Apache MINA Project

- - ### Nested Class Summary

    - ### Nested classes/interfaces inherited from interface org.apache.mina.core.filterchain.IoFilter

      `IoFilter.NextFilter`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `CommonEventFilter()`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `exceptionCaught(IoFilter.NextFilter nextFilter, IoSession session, Throwable cause)` Filters `IoHandler.exceptionCaught(IoSession,Throwable)` event.
    `protected abstract void` | `filter(IoFilterEvent event)`
    `void` | `filterClose(IoFilter.NextFilter nextFilter, IoSession session)` Filters `IoSession.close()` method invocation.
    `void` | `filterWrite(IoFilter.NextFilter nextFilter, IoSession session, 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, WriteRequest writeRequest)` Filters `IoHandler.messageSent(IoSession,Object)` event.
    `void` | `sessionClosed(IoFilter.NextFilter nextFilter, IoSession session)` Filters `IoHandler.sessionClosed(IoSession)` event.
    `void` | `sessionCreated(IoFilter.NextFilter nextFilter, IoSession session)` Filters `IoHandler.sessionCreated(IoSession)` event.
    `void` | `sessionIdle(IoFilter.NextFilter nextFilter, IoSession session, IdleStatus status)` Filters `IoHandler.sessionIdle(IoSession,IdleStatus)` event.
    `void` | `sessionOpened(IoFilter.NextFilter nextFilter, IoSession session)` Filters `IoHandler.sessionOpened(IoSession)` event.

    - ### Methods inherited from class org.apache.mina.core.filterchain.IoFilterAdapter

      `destroy, init, onPostAdd, onPostRemove, onPreAdd, onPreRemove, toString`

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

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

- - ### Constructor Detail

    - #### CommonEventFilter

          public CommonEventFilter()

  - ### Method Detail

    - #### filter

          protected abstract void filter(IoFilterEvent event)
                                  throws Exception

      Throws:
        `Exception`

    - #### sessionCreated

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

      Description copied from class: `IoFilterAdapter`
      Filters `IoHandler.sessionCreated(IoSession)` event.
      Specified by:
        `sessionCreated` in interface `IoFilter`
      Overrides:
        `sessionCreated` in class `IoFilterAdapter`
      Throws:
        `Exception`

    - #### sessionOpened

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

      Description copied from class: `IoFilterAdapter`
      Filters `IoHandler.sessionOpened(IoSession)` event.
      Specified by:
        `sessionOpened` in interface `IoFilter`
      Overrides:
        `sessionOpened` in class `IoFilterAdapter`
      Throws:
        `Exception`

    - #### sessionClosed

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

      Description copied from class: `IoFilterAdapter`
      Filters `IoHandler.sessionClosed(IoSession)` event.
      Specified by:
        `sessionClosed` in interface `IoFilter`
      Overrides:
        `sessionClosed` in class `IoFilterAdapter`
      Throws:
        `Exception`

    - #### sessionIdle

          public final void sessionIdle(IoFilter.NextFilter nextFilter,
                         IoSession session,
                         IdleStatus status)
                                 throws Exception

      Description copied from class: `IoFilterAdapter`
      Filters `IoHandler.sessionIdle(IoSession,IdleStatus)` event.
      Specified by:
        `sessionIdle` in interface `IoFilter`
      Overrides:
        `sessionIdle` in class `IoFilterAdapter`
      Throws:
        `Exception`

    - #### exceptionCaught

          public final void exceptionCaught(IoFilter.NextFilter nextFilter,
                             IoSession session,
                             Throwable cause)
                                     throws Exception

      Description copied from class: `IoFilterAdapter`
      Filters `IoHandler.exceptionCaught(IoSession,Throwable)` event.
      Specified by:
        `exceptionCaught` in interface `IoFilter`
      Overrides:
        `exceptionCaught` in class `IoFilterAdapter`
      Throws:
        `Exception`

    - #### messageReceived

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

      Description copied from class: `IoFilterAdapter`
      Filters `IoHandler.messageReceived(IoSession,Object)` event.
      Specified by:
        `messageReceived` in interface `IoFilter`
      Overrides:
        `messageReceived` in class `IoFilterAdapter`
      Throws:
        `Exception`

    - #### messageSent

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

      Description copied from class: `IoFilterAdapter`
      Filters `IoHandler.messageSent(IoSession,Object)` event.
      Specified by:
        `messageSent` in interface `IoFilter`
      Overrides:
        `messageSent` in class `IoFilterAdapter`
      Throws:
        `Exception`

    - #### filterWrite

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

      Description copied from class: `IoFilterAdapter`
      Filters `IoSession.write(Object)` method invocation.
      Specified by:
        `filterWrite` in interface `IoFilter`
      Overrides:
        `filterWrite` in class `IoFilterAdapter`
      Throws:
        `Exception`

    - #### filterClose

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

      Description copied from class: `IoFilterAdapter`
      Filters `IoSession.close()` method invocation.
      Specified by:
        `filterClose` in interface `IoFilter`
      Overrides:
        `filterClose` in class `IoFilterAdapter`
      Throws:
        `Exception`

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