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.common
Interface IoFilterChain

    public interface IoFilterChain

A container of `IoFilter`s that forwards `IoHandler` events to the consisting filters and terminal `IoHandler` sequentially. Every `IoSession` has its own `IoFilterChain` (1-to-1 relationship).

Version:
  $Rev: 555855 $, $Date: 2007-07-13 12:19:00 +0900 (Fri, 13 Jul 2007) $
Author:
  The Apache Directory Project (mina-dev@directory.apache.org)

Nested Class Summary
`static interface` | `IoFilterChain.Entry` Represents a name-filter pair that an `IoFilterChain` contains.

Method Summary
`void` | `addAfter(String baseName, String name, IoFilter filter)` Adds the specified filter with the specified name just after the filter whose name is `baseName` in this chain.
`void` | `addBefore(String baseName, String name, IoFilter filter)` Adds the specified filter with the specified name just before the filter whose name is `baseName` in this chain.
`void` | `addFirst(String name, IoFilter filter)` Adds the specified filter with the specified name at the beginning of this chain.
`void` | `addLast(String name, IoFilter filter)` Adds the specified filter with the specified name at the end of this chain.
`void` | `clear()` Removes all filters added to this chain.
`boolean` | `contains(Class<? extends IoFilter> filterType)` Returns `true` if this chain contains an `IoFilter` of the specified `filterType`.
`boolean` | `contains(IoFilter filter)` Returns `true` if this chain contains the specified `filter`.
`boolean` | `contains(String name)` Returns `true` if this chain contains an `IoFilter` with the specified `name`.
`void` | `fireExceptionCaught(IoSession session, Throwable cause)` Fires a `IoHandler.exceptionCaught(IoSession, Throwable)` event.
`void` | `fireFilterClose(IoSession session)` Fires a `IoSession.close()` event.
`void` | `fireFilterWrite(IoSession session, IoFilter.WriteRequest writeRequest)` Fires a `IoSession.write(Object)` event.
`void` | `fireMessageReceived(IoSession session, Object message)` Fires a `fireMessageReceived(IoSession, Object)` event.
`void` | `fireMessageSent(IoSession session, IoFilter.WriteRequest request)` Fires a `IoHandler.sessionOpened(IoSession)` event.
`void` | `fireSessionClosed(IoSession session)` Fires a `IoHandler.sessionClosed(IoSession)` event.
`void` | `fireSessionCreated(IoSession session)` Fires a `IoHandler.sessionCreated(IoSession)` event.
`void` | `fireSessionIdle(IoSession session, IdleStatus status)` Fires a `IoHandler.sessionIdle(IoSession, IdleStatus)` event.
`void` | `fireSessionOpened(IoSession session)` Fires a `IoHandler.sessionOpened(IoSession)` event.
`IoFilter` | `get(String name)` Returns the `IoFilter` with the specified `name` in this chain.
`List<IoFilterChain.Entry>` | `getAll()` Returns the list of all `IoFilterChain.Entry`s this chain contains.
`List<IoFilterChain.Entry>` | `getAllReversed()` Returns the reversed list of all `IoFilterChain.Entry`s this chain contains.
`IoFilterChain.Entry` | `getEntry(String name)` Returns the `IoFilterChain.Entry` with the specified `name` in this chain.
`IoFilter.NextFilter` | `getNextFilter(String name)` Returns the `IoFilter.NextFilter` of the `IoFilter` with the specified `name` in this chain.
`IoSession` | `getSession()` Returns the parent `IoSession` of this chain.
`IoFilter` | `remove(String name)` Removes the filter with the specified name from this chain.

Method Detail

### getSession

    IoSession getSession()

  Returns the parent `IoSession` of this chain.

  Returns:
    `IoSession`

### getEntry

    IoFilterChain.Entry getEntry(String name)

  Returns the `IoFilterChain.Entry` with the specified `name` in this chain.

  Returns:
    `null` if there's no such name in this chain

### get

    IoFilter get(String name)

  Returns the `IoFilter` with the specified `name` in this chain.

  Returns:
    `null` if there's no such name in this chain

### getNextFilter

    IoFilter.NextFilter getNextFilter(String name)

  Returns the `IoFilter.NextFilter` of the `IoFilter` with the specified `name` in this chain.

  Returns:
    `null` if there's no such name in this chain

### getAll

    List<IoFilterChain.Entry> getAll()

  Returns the list of all `IoFilterChain.Entry`s this chain contains.

### getAllReversed

    List<IoFilterChain.Entry> getAllReversed()

  Returns the reversed list of all `IoFilterChain.Entry`s this chain contains.

### contains

    boolean contains(String name)

  Returns `true` if this chain contains an `IoFilter` with the specified `name`.

### contains

    boolean contains(IoFilter filter)

  Returns `true` if this chain contains the specified `filter`.

### contains

    boolean contains(Class<? extends IoFilter> filterType)

  Returns `true` if this chain contains an `IoFilter` of the specified `filterType`.

### addFirst

    void addFirst(String name,
                  IoFilter filter)

  Adds the specified filter with the specified name at the beginning of this chain.

  Throws:
    `IoFilterLifeCycleException` - if `IoFilter.onPostAdd(IoFilterChain, String, NextFilter)` or `IoFilter.init()` throws an exception.

### addLast

    void addLast(String name,
                 IoFilter filter)

  Adds the specified filter with the specified name at the end of this chain.

  Throws:
    `IoFilterLifeCycleException` - if `IoFilter.onPostAdd(IoFilterChain, String, NextFilter)` or `IoFilter.init()` throws an exception.

### addBefore

    void addBefore(String baseName,
                   String name,
                   IoFilter filter)

  Adds the specified filter with the specified name just before the filter whose name is `baseName` in this chain.

  Throws:
    `IoFilterLifeCycleException` - if `IoFilter.onPostAdd(IoFilterChain, String, NextFilter)` or `IoFilter.init()` throws an exception.

### addAfter

    void addAfter(String baseName,
                  String name,
                  IoFilter filter)

  Adds the specified filter with the specified name just after the filter whose name is `baseName` in this chain.

  Throws:
    `IoFilterLifeCycleException` - if `IoFilter.onPostAdd(IoFilterChain, String, NextFilter)` or `IoFilter.init()` throws an exception.

### remove

    IoFilter remove(String name)

  Removes the filter with the specified name from this chain.

  Throws:
    `IoFilterLifeCycleException` - if `IoFilter.onPostRemove(IoFilterChain, String, NextFilter)` or `IoFilter.destroy()` throws an exception.

### clear

    void clear()
               throws Exception

  Removes all filters added to this chain.

  Throws:
    `Exception` - if `IoFilter.onPostRemove(IoFilterChain, String, NextFilter)` thrown an exception.

### fireSessionCreated

    void fireSessionCreated(IoSession session)

  Fires a `IoHandler.sessionCreated(IoSession)` event. Most users don't need to call this method at all. Please use this method only when you implement a new transport or fire a virtual event.

### fireSessionOpened

    void fireSessionOpened(IoSession session)

  Fires a `IoHandler.sessionOpened(IoSession)` event. Most users don't need to call this method at all. Please use this method only when you implement a new transport or fire a virtual event.

### fireSessionClosed

    void fireSessionClosed(IoSession session)

  Fires a `IoHandler.sessionClosed(IoSession)` event. Most users don't need to call this method at all. Please use this method only when you implement a new transport or fire a virtual event.

### fireSessionIdle

    void fireSessionIdle(IoSession session,
                         IdleStatus status)

  Fires a `IoHandler.sessionIdle(IoSession, IdleStatus)` event. Most users don't need to call this method at all. Please use this method only when you implement a new transport or fire a virtual event.

### fireMessageReceived

    void fireMessageReceived(IoSession session,
                             Object message)

  Fires a `fireMessageReceived(IoSession, Object)` event. Most users don't need to call this method at all. Please use this method only when you implement a new transport or fire a virtual event.

### fireMessageSent

    void fireMessageSent(IoSession session,
                         IoFilter.WriteRequest request)

  Fires a `IoHandler.sessionOpened(IoSession)` event. Most users don't need to call this method at all. Please use this method only when you implement a new transport or fire a virtual event.

### fireExceptionCaught

    void fireExceptionCaught(IoSession session,
                             Throwable cause)

  Fires a `IoHandler.exceptionCaught(IoSession, Throwable)` event. Most users don't need to call this method at all. Please use this method only when you implement a new transport or fire a virtual event.

### fireFilterWrite

    void fireFilterWrite(IoSession session,
                         IoFilter.WriteRequest writeRequest)

  Fires a `IoSession.write(Object)` event. Most users don't need to call this method at all. Please use this method only when you implement a new transport or fire a virtual event.

### fireFilterClose

    void fireFilterClose(IoSession session)

  Fires a `IoSession.close()` event. Most users don't need to call this method at all. Please use this method only when you implement a new transport or fire a virtual event.

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.