org.apache.mina.filter.executor

## Class IoEventQueueThrottle

- java.lang.Object
- - org.apache.mina.filter.executor.IoEventQueueThrottle

- All Implemented Interfaces:
    EventListener, IoEventQueueHandler

      public class IoEventQueueThrottle
      extends 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

    Constructors
    Constructor and Description
    `IoEventQueueThrottle()`
    `IoEventQueueThrottle(int threshold)`
    `IoEventQueueThrottle(IoEventSizeEstimator eventSizeEstimator, int threshold)`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `boolean` | `accept(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(Object source, IoEvent event)` Invoked after the specified `event` has been offered to the event queue.
    `void` | `polled(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(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(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(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-2012 Apache MINA Project. All Rights Reserved.