public class SimpleBucketListener extends Object implements BucketListener
NOPE| Constructor and Description |
|---|
SimpleBucketListener() |
| Modifier and Type | Method and Description |
|---|---|
long |
getConsumed() |
long |
getDelayedNanos() |
long |
getInterrupted() |
long |
getParkedNanos() |
long |
getRejected() |
void |
onConsumed(long tokens)
This method is called whenever
tokens is consumed. |
void |
onDelayed(long nanos)
This method is called each time when delayed task was submit to
ScheduledExecutorService because of wait for tokens refill
in result of interaction with AsyncScheduledBucket |
void |
onInterrupted(InterruptedException e)
This method is called each time when thread was interrupted during the wait of tokens refill
in result of interaction with
BlockingBucket |
void |
onParked(long nanos)
This method is called each time when thread was parked for wait of tokens refill
in result of interaction with
BlockingBucket |
void |
onRejected(long tokens)
This method is called whenever consumption request for
tokens is rejected. |
public void onConsumed(long tokens)
BucketListenertokens is consumed.onConsumed in interface BucketListenertokens - amount of tokens that consumedpublic void onRejected(long tokens)
BucketListenertokens is rejected.onRejected in interface BucketListenertokens - amount of tokens that rejectedpublic void onDelayed(long nanos)
BucketListenerScheduledExecutorService because of wait for tokens refill
in result of interaction with AsyncScheduledBucketonDelayed in interface BucketListenernanos - amount of nanoseconds for which thread was parkedpublic void onParked(long nanos)
BucketListenerBlockingBucketonParked in interface BucketListenernanos - amount of nanoseconds for which thread was parkedpublic void onInterrupted(InterruptedException e)
BucketListenerBlockingBucketonInterrupted in interface BucketListenere - InterruptedExceptionpublic long getConsumed()
public long getRejected()
public long getDelayedNanos()
public long getParkedNanos()
public long getInterrupted()
Copyright © 2021. All rights reserved.