org.apache.mina.io.filter
Class IoThreadPoolFilter

java.lang.Object
  extended by org.apache.mina.util.BaseThreadPool
      extended by org.apache.mina.io.filter.IoThreadPoolFilter
All Implemented Interfaces:
IoFilter, ThreadPool

public class IoThreadPoolFilter
extends BaseThreadPool
implements ThreadPool, IoFilter

A Thread-pooling filter. This filter forwards IoHandler events to its thread pool.

Version:
$Rev: 332218 $, $Date: 2005-11-10 12:52:42 +0900 $
Author:
The Apache Directory Project (dev@directory.apache.org)
See Also:
ThreadPool, BaseThreadPool

Nested Class Summary
 
Nested classes/interfaces inherited from class org.apache.mina.util.BaseThreadPool
BaseThreadPool.SessionBuffer
 
Nested classes/interfaces inherited from interface org.apache.mina.io.IoFilter
IoFilter.NextFilter
 
Field Summary
 
Fields inherited from class org.apache.mina.util.BaseThreadPool
DEFAULT_KEEP_ALIVE_TIME, DEFAULT_MAXIMUM_POOL_SIZE
 
Constructor Summary
IoThreadPoolFilter()
          Creates a new instance of this filter with default thread pool settings.
IoThreadPoolFilter(String threadNamePrefix)
          Creates a new instance of this filter with default thread pool settings.
 
Method Summary
 void dataRead(IoFilter.NextFilter nextFilter, IoSession session, ByteBuffer buf)
          Filters IoHandler.dataRead(IoSession, ByteBuffer) event.
 void dataWritten(IoFilter.NextFilter nextFilter, IoSession session, Object marker)
          Filters IoHandler.dataWritten(IoSession, Object) event.
 void exceptionCaught(IoFilter.NextFilter nextFilter, IoSession session, Throwable cause)
          Filters IoHandler.exceptionCaught(IoSession, Throwable) event.
 void filterWrite(IoFilter.NextFilter nextFilter, IoSession session, ByteBuffer buf, Object marker)
          Filters IoSession.write(ByteBuffer, Object) method invocation.
protected  void processEvent(Object nextFilter0, Session session0, EventType type, Object data)
          Implement this method to forward events to nextFilter.
 void sessionClosed(IoFilter.NextFilter nextFilter, IoSession session)
          Filters IoHandler.sessionClosed(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.util.BaseThreadPool
fetchSessionBuffer, fireEvent, getKeepAliveTime, getMaximumPoolSize, getPoolSize, getThreadNamePrefix, setKeepAliveTime, setMaximumPoolSize, start, stop
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.apache.mina.util.ThreadPool
getKeepAliveTime, getMaximumPoolSize, getPoolSize, setKeepAliveTime, setMaximumPoolSize, start, stop
 

Constructor Detail

IoThreadPoolFilter

public IoThreadPoolFilter()
Creates a new instance of this filter with default thread pool settings. You'll have to invoke BaseThreadPool.start() method to start threads actually.


IoThreadPoolFilter

public IoThreadPoolFilter(String threadNamePrefix)
Creates a new instance of this filter with default thread pool settings. You'll have to invoke BaseThreadPool.start() method to start threads actually.

Parameters:
threadNamePrefix - the prefix of the thread names this pool will create.
Method Detail

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

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

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

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

dataRead

public void dataRead(IoFilter.NextFilter nextFilter,
                     IoSession session,
                     ByteBuffer buf)
Description copied from interface: IoFilter
Filters IoHandler.dataRead(IoSession, ByteBuffer) event.

Specified by:
dataRead in interface IoFilter

dataWritten

public void dataWritten(IoFilter.NextFilter nextFilter,
                        IoSession session,
                        Object marker)
Description copied from interface: IoFilter
Filters IoHandler.dataWritten(IoSession, Object) event.

Specified by:
dataWritten in interface IoFilter

processEvent

protected void processEvent(Object nextFilter0,
                            Session session0,
                            EventType type,
                            Object data)
Description copied from class: BaseThreadPool
Implement this method to forward events to nextFilter.

Specified by:
processEvent in class BaseThreadPool

filterWrite

public void filterWrite(IoFilter.NextFilter nextFilter,
                        IoSession session,
                        ByteBuffer buf,
                        Object marker)
                 throws Exception
Description copied from interface: IoFilter
Filters IoSession.write(ByteBuffer, Object) method invocation.

Specified by:
filterWrite in interface IoFilter
Throws:
Exception


Copyright © 2004-2005 . All Rights Reserved.