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 IoEventQueueHandler
source
- The source of eventevent
- The received eventpublic void offered(Object source, IoEvent event)
offered
in interface IoEventQueueHandler
source
- The source of eventevent
- The received eventpublic void polled(Object source, IoEvent event)
polled
in interface IoEventQueueHandler
source
- The source of eventevent
- The received eventprotected void block()
protected void unblock()
Copyright © 2004–2021 Apache MINA Project. All rights reserved.