public class IoEventQueueThrottle extends Object implements IoEventQueueHandler
NOOP| Constructor and Description |
|---|
IoEventQueueThrottle()
Creates a new IoEventQueueThrottle instance
|
IoEventQueueThrottle(int threshold)
Creates a new IoEventQueueThrottle instance
|
IoEventQueueThrottle(IoEventSizeEstimator eventSizeEstimator,
int threshold)
Creates a new IoEventQueueThrottle instance
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
accept(Object source,
IoEvent event) |
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)
Sets the events threshold
|
protected void |
unblock() |
public IoEventQueueThrottle()
public IoEventQueueThrottle(int threshold)
threshold - The events thresholdpublic IoEventQueueThrottle(IoEventSizeEstimator eventSizeEstimator, int threshold)
eventSizeEstimator - The IoEventSizeEstimator instancethreshold - The events thresholdpublic IoEventSizeEstimator getEventSizeEstimator()
public int getThreshold()
public int getCounter()
public void setThreshold(int threshold)
threshold - The events thresholdpublic boolean accept(Object source, IoEvent event)
accept in interface IoEventQueueHandlersource - The source of eventevent - The received eventtrue if and only if the specified event is
allowed to be offered to the event queue. The event is dropped
if false is returned.public void offered(Object source, IoEvent event)
event has been offered to the
event queue.offered in interface IoEventQueueHandlersource - The source of eventevent - The received eventpublic void polled(Object source, IoEvent event)
event has been polled from the
event queue.polled in interface IoEventQueueHandlersource - The source of eventevent - The received eventprotected void block()
protected void unblock()
Copyright © 2004–2024 Apache MINA Project. All rights reserved.