org.apache.mina.core.filterchain

## Class IoFilterAdapter

- java.lang.Object
- - org.apache.mina.core.filterchain.IoFilterAdapter

- All Implemented Interfaces:
    IoFilter
  Direct Known Subclasses:
    AbstractStreamWriteFilter, BlacklistFilter, BufferedWriteFilter, CommonEventFilter, ConnectionThrottleFilter, ErrorGeneratingFilter, ExecutorFilter, KeepAliveFilter, LoggingFilter, NoopFilter, ProfilerTimerFilter, ProtocolCodecFilter, ProxyFilter, ReferenceCountingFilter, SessionAttributeInitializingFilter, SslFilter, ToHaikuIoFilter, WriteRequestFilter, WriteRequestFilter

      public class IoFilterAdapter
      extends Object
      implements IoFilter

  An adapter class for `IoFilter`. You can extend this class and selectively override required event filter methods only. All methods forwards events to the next filter by default.
  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
    `IoFilterAdapter()`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `destroy()` Invoked by `ReferenceCountingFilter` when this filter is not used by any `IoFilterChain` anymore, so you can destroy shared resources.
    `void` | `exceptionCaught(IoFilter.NextFilter nextFilter, IoSession session, Throwable cause)` Filters `IoHandler.exceptionCaught(IoSession,Throwable)` 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` | `init()` Invoked by `ReferenceCountingFilter` when this filter is added to a `IoFilterChain` at the first time, so you can initialize shared resources.
    `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` | `onPostAdd(IoFilterChain parent, String name, IoFilter.NextFilter nextFilter)` Invoked after this filter is added to the specified `parent`.
    `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` | `onPreRemove(IoFilterChain parent, String name, IoFilter.NextFilter nextFilter)` Invoked before this filter is removed from the specified `parent`.
    `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.
    `String` | `toString()`

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

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

- - ### Constructor Detail

    - #### IoFilterAdapter

          public IoFilterAdapter()

  - ### Method Detail

    - #### init

          public void init()
                    throws Exception

      Invoked by `ReferenceCountingFilter` when this filter is added to a `IoFilterChain` at the first time, so you can initialize shared resources. Please note that this method is never called if you don't wrap a filter with `ReferenceCountingFilter`.
      Specified by:
        `init` in interface `IoFilter`
      Throws:
        `Exception`

    - #### destroy

          public void destroy()
                       throws Exception

      Invoked by `ReferenceCountingFilter` when this filter is not used by any `IoFilterChain` anymore, so you can destroy shared resources. Please note that this method is never called if you don't wrap a filter with `ReferenceCountingFilter`.
      Specified by:
        `destroy` in interface `IoFilter`
      Throws:
        `Exception`

    - #### onPreAdd

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

      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`
      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`

    - #### onPostAdd

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

      Invoked after 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:
        `onPostAdd` in interface `IoFilter`
      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`

    - #### onPreRemove

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

      Invoked before 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:
        `onPreRemove` in interface `IoFilter`
      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

      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`
      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`

    - #### sessionCreated

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

      Filters `IoHandler.sessionCreated(IoSession)` event.
      Specified by:
        `sessionCreated` in interface `IoFilter`
      Throws:
        `Exception`

    - #### sessionOpened

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

      Filters `IoHandler.sessionOpened(IoSession)` event.
      Specified by:
        `sessionOpened` in interface `IoFilter`
      Throws:
        `Exception`

    - #### sessionClosed

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

      Filters `IoHandler.sessionClosed(IoSession)` event.
      Specified by:
        `sessionClosed` in interface `IoFilter`
      Throws:
        `Exception`

    - #### sessionIdle

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

      Filters `IoHandler.sessionIdle(IoSession,IdleStatus)` event.
      Specified by:
        `sessionIdle` in interface `IoFilter`
      Throws:
        `Exception`

    - #### exceptionCaught

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

      Filters `IoHandler.exceptionCaught(IoSession,Throwable)` event.
      Specified by:
        `exceptionCaught` in interface `IoFilter`
      Throws:
        `Exception`

    - #### messageReceived

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

      Filters `IoHandler.messageReceived(IoSession,Object)` event.
      Specified by:
        `messageReceived` in interface `IoFilter`
      Throws:
        `Exception`

    - #### messageSent

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

      Filters `IoHandler.messageSent(IoSession,Object)` event.
      Specified by:
        `messageSent` in interface `IoFilter`
      Throws:
        `Exception`

    - #### filterWrite

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

      Filters `IoSession.write(Object)` method invocation.
      Specified by:
        `filterWrite` in interface `IoFilter`
      Throws:
        `Exception`

    - #### filterClose

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

      Filters `IoSession.close()` method invocation.
      Specified by:
        `filterClose` in interface `IoFilter`
      Throws:
        `Exception`

    - #### toString

          public String toString()

      Overrides:
        `toString` in class `Object`

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