org.apache.mina.filter.executor
Class IoEventQueueThrottle

java.lang.Object
  extended by org.apache.mina.filter.executor.IoEventQueueThrottle
All Implemented Interfaces:
java.util.EventListener, IoEventQueueHandler

public class IoEventQueueThrottle
extends java.lang.Object
implements IoEventQueueHandler

Throttles incoming or outgoing events.

Author:
Apache MINA Project

Field Summary
 
Fields inherited from interface org.apache.mina.filter.executor.IoEventQueueHandler
NOOP
 
Constructor Summary
IoEventQueueThrottle()
           
IoEventQueueThrottle(int threshold)
           
IoEventQueueThrottle(IoEventSizeEstimator eventSizeEstimator, int threshold)
           
 
Method Summary
 boolean accept(java.lang.Object source, IoEvent event)
          Returns true if and only if the specified event is allowed to be offered to the event queue.
protected  void block()
           
 int getCounter()
           
 IoEventSizeEstimator getEventSizeEstimator()
           
 int getThreshold()
           
 void offered(java.lang.Object source, IoEvent event)
          Invoked after the specified event has been offered to the event queue.
 void polled(java.lang.Object source, IoEvent event)
          Invoked after the specified event has been polled from the event queue.
 void setThreshold(int threshold)
           
protected  void unblock()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

IoEventQueueThrottle

public IoEventQueueThrottle()

IoEventQueueThrottle

public IoEventQueueThrottle(int threshold)

IoEventQueueThrottle

public IoEventQueueThrottle(IoEventSizeEstimator eventSizeEstimator,
                            int threshold)
Method Detail

getEventSizeEstimator

public IoEventSizeEstimator getEventSizeEstimator()

getThreshold

public int getThreshold()

getCounter

public int getCounter()

setThreshold

public void setThreshold(int threshold)

accept

public boolean accept(java.lang.Object source,
                      IoEvent event)
Description copied from interface: IoEventQueueHandler
Returns true if and only if the specified event is allowed to be offered to the event queue. The event is dropped if false is returned.

Specified by:
accept in interface IoEventQueueHandler

offered

public void offered(java.lang.Object source,
                    IoEvent event)
Description copied from interface: IoEventQueueHandler
Invoked after the specified event has been offered to the event queue.

Specified by:
offered in interface IoEventQueueHandler

polled

public void polled(java.lang.Object source,
                   IoEvent event)
Description copied from interface: IoEventQueueHandler
Invoked after the specified event has been polled from the event queue.

Specified by:
polled in interface IoEventQueueHandler

block

protected void block()

unblock

protected void unblock()


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