org.apache.mina.protocol.filter
Class ProtocolThreadPoolFilter

java.lang.Object
  extended by org.apache.mina.util.BaseThreadPool
      extended by org.apache.mina.protocol.filter.ProtocolThreadPoolFilter
All Implemented Interfaces:
ProtocolFilter, ThreadPool

public class ProtocolThreadPoolFilter
extends BaseThreadPool
implements ThreadPool, ProtocolFilter

A Thread-pooling filter. This filter forwards ProtocolHandler 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.protocol.ProtocolFilter
ProtocolFilter.NextFilter
 
Field Summary
 
Fields inherited from class org.apache.mina.util.BaseThreadPool
DEFAULT_KEEP_ALIVE_TIME, DEFAULT_MAXIMUM_POOL_SIZE
 
Constructor Summary
ProtocolThreadPoolFilter()
          Creates a new instanceof this filter with default thread pool settings.
ProtocolThreadPoolFilter(String threadNamePrefix)
          Creates a new instance of this filter with default thread pool settings.
 
Method Summary
 void exceptionCaught(ProtocolFilter.NextFilter nextFilter, ProtocolSession session, Throwable cause)
          Filters ProtocolHandler.exceptionCaught(ProtocolSession,Throwable) event.
 void filterWrite(ProtocolFilter.NextFilter nextFilter, ProtocolSession session, Object message)
          Filters ProtocolSession.write(Object) method invocation.
 void messageReceived(ProtocolFilter.NextFilter nextFilter, ProtocolSession session, Object message)
          Filters ProtocolHandler.messageReceived(ProtocolSession,Object) event.
 void messageSent(ProtocolFilter.NextFilter nextFilter, ProtocolSession session, Object message)
          Filters ProtocolHandler.messageSent(ProtocolSession,Object) event.
protected  void processEvent(Object nextFilter0, Session session0, EventType type, Object data)
          Implement this method to forward events to nextFilter.
 void sessionClosed(ProtocolFilter.NextFilter nextFilter, ProtocolSession session)
          Filters ProtocolHandler.sessionClosed(ProtocolSession) event.
 void sessionIdle(ProtocolFilter.NextFilter nextFilter, ProtocolSession session, IdleStatus status)
          Filters ProtocolHandler.sessionIdle(ProtocolSession,IdleStatus) event.
 void sessionOpened(ProtocolFilter.NextFilter nextFilter, ProtocolSession session)
          Filters ProtocolHandler.sessionOpened(ProtocolSession) 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

ProtocolThreadPoolFilter

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


ProtocolThreadPoolFilter

public ProtocolThreadPoolFilter(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(ProtocolFilter.NextFilter nextFilter,
                          ProtocolSession session)
Description copied from interface: ProtocolFilter
Filters ProtocolHandler.sessionOpened(ProtocolSession) event.

Specified by:
sessionOpened in interface ProtocolFilter

sessionClosed

public void sessionClosed(ProtocolFilter.NextFilter nextFilter,
                          ProtocolSession session)
Description copied from interface: ProtocolFilter
Filters ProtocolHandler.sessionClosed(ProtocolSession) event.

Specified by:
sessionClosed in interface ProtocolFilter

sessionIdle

public void sessionIdle(ProtocolFilter.NextFilter nextFilter,
                        ProtocolSession session,
                        IdleStatus status)
Description copied from interface: ProtocolFilter
Filters ProtocolHandler.sessionIdle(ProtocolSession,IdleStatus) event.

Specified by:
sessionIdle in interface ProtocolFilter

exceptionCaught

public void exceptionCaught(ProtocolFilter.NextFilter nextFilter,
                            ProtocolSession session,
                            Throwable cause)
Description copied from interface: ProtocolFilter
Filters ProtocolHandler.exceptionCaught(ProtocolSession,Throwable) event.

Specified by:
exceptionCaught in interface ProtocolFilter

messageReceived

public void messageReceived(ProtocolFilter.NextFilter nextFilter,
                            ProtocolSession session,
                            Object message)
Description copied from interface: ProtocolFilter
Filters ProtocolHandler.messageReceived(ProtocolSession,Object) event.

Specified by:
messageReceived in interface ProtocolFilter

messageSent

public void messageSent(ProtocolFilter.NextFilter nextFilter,
                        ProtocolSession session,
                        Object message)
Description copied from interface: ProtocolFilter
Filters ProtocolHandler.messageSent(ProtocolSession,Object) event.

Specified by:
messageSent in interface ProtocolFilter

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(ProtocolFilter.NextFilter nextFilter,
                        ProtocolSession session,
                        Object message)
Description copied from interface: ProtocolFilter
Filters ProtocolSession.write(Object) method invocation.

Specified by:
filterWrite in interface ProtocolFilter


Copyright © 2004-2005 . All Rights Reserved.