public class SynchronizedBucket extends AbstractBucket
UNSPECIFIED_WAITING_LIMIT| Constructor and Description |
|---|
SynchronizedBucket(BucketConfiguration configuration) |
| Modifier and Type | Method and Description |
|---|---|
protected void |
addTokensImpl(long tokensToAdd) |
protected long |
consumeAsMuchAsPossibleImpl(long limit) |
protected boolean |
consumeOrAwaitImpl(long tokensToConsume,
long waitIfBusyNanosLimit,
boolean uninterruptibly,
BlockingStrategy blockingStrategy) |
BucketState |
createSnapshot()
Creates the copy of internal state.
|
BucketConfiguration |
getConfiguration()
Returns configuration of this bucket.
|
String |
toString() |
protected boolean |
tryConsumeImpl(long tokensToConsume) |
addTokens, consume, consume, consumeUninterruptibly, consumeUninterruptibly, tryConsume, tryConsumeAsMuchAsPossible, tryConsumeAsMuchAsPossiblepublic SynchronizedBucket(BucketConfiguration configuration)
protected long consumeAsMuchAsPossibleImpl(long limit)
consumeAsMuchAsPossibleImpl in class AbstractBucketprotected boolean tryConsumeImpl(long tokensToConsume)
tryConsumeImpl in class AbstractBucketprotected boolean consumeOrAwaitImpl(long tokensToConsume,
long waitIfBusyNanosLimit,
boolean uninterruptibly,
BlockingStrategy blockingStrategy)
throws InterruptedException
consumeOrAwaitImpl in class AbstractBucketInterruptedExceptionprotected void addTokensImpl(long tokensToAdd)
addTokensImpl in class AbstractBucketpublic BucketState createSnapshot()
BucketThis method is designed to be used only for monitoring and testing, you should never use this method for business cases.
public BucketConfiguration getConfiguration()
BucketCopyright © 2017. All rights reserved.