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.executor
Class ExecutorFilter

    java.lang.Object
      org.apache.mina.common.IoFilterAdapter
          org.apache.mina.filter.executor.ExecutorFilter

All Implemented Interfaces:
  IoFilter

    public class ExecutorFilter

extends IoFilterAdapter

A filter that forward events to `Executor` in backport-util-concurrent. You can apply various thread model by inserting this filter to the `IoFilterChain`.

Please note that this filter doesn't manage the life cycle of the underlying `Executor`. You have to destroy or stop it by yourself.

Version:
  $Rev: 350169 $, $Date: 2005-12-01 00:17:41 -0500 (Thu, 01 Dec 2005) $
Author:
  The Apache MINA Project (dev@mina.apache.org)

Nested Class Summary
`protected static class` | `ExecutorFilter.Event`
`protected static class` | `ExecutorFilter.EventType`

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

Constructor Summary
`ExecutorFilter()` Creates a new instace with the default thread pool implementation (`new ThreadPoolExecutor(16, 16, 60, TimeUnit.SECONDS, new LinkedBlockingQueue() )`).
`ExecutorFilter(Executor executor)` Creates a new instance with the specified `executor`.

Method Summary
`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, IoFilter.WriteRequest writeRequest)` Filters `IoSession.write(Object)` method invocation.
`Executor` | `getExecutor()` Returns the underlying `Executor` instance this filter uses.
`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.
`protected void` | `processEvent(IoFilter.NextFilter nextFilter, IoSession session, ExecutorFilter.EventType type, Object data)`
`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.common.IoFilterAdapter
`destroy, init, onPostAdd, onPostRemove, onPreAdd, onPreRemove`

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

Constructor Detail

### ExecutorFilter

    public ExecutorFilter()

  Creates a new instace with the default thread pool implementation (`new ThreadPoolExecutor(16, 16, 60, TimeUnit.SECONDS, new LinkedBlockingQueue() )`).

### ExecutorFilter

    public ExecutorFilter(Executor executor)

  Creates a new instance with the specified `executor`.

Method Detail

### getExecutor

    public Executor getExecutor()

  Returns the underlying `Executor` instance this filter uses.

### sessionCreated

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

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

  Specified by:
    `sessionCreated` in interface `IoFilter`
  Overrides:
    `sessionCreated` in class `IoFilterAdapter`

### sessionOpened

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

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

  Specified by:
    `sessionOpened` in interface `IoFilter`
  Overrides:
    `sessionOpened` in class `IoFilterAdapter`

### sessionClosed

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

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

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

### sessionIdle

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

  Description copied from interface: `IoFilter`
  Filters `IoHandler.sessionIdle(IoSession,IdleStatus)` event.

  Specified by:
    `sessionIdle` in interface `IoFilter`
  Overrides:
    `sessionIdle` in class `IoFilterAdapter`

### exceptionCaught

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

  Description copied from interface: `IoFilter`
  Filters `IoHandler.exceptionCaught(IoSession,Throwable)` event.

  Specified by:
    `exceptionCaught` in interface `IoFilter`
  Overrides:
    `exceptionCaught` in class `IoFilterAdapter`

### messageReceived

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

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

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

### messageSent

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

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

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

### processEvent

    protected void processEvent(IoFilter.NextFilter nextFilter,
                                IoSession session,
                                ExecutorFilter.EventType type,
                                Object data)

### filterWrite

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

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

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

### filterClose

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

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

  Specified by:
    `filterClose` in interface `IoFilter`
  Overrides:
    `filterClose` 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.