public class LocalBucketBuilder extends ConfigurationBuilder<LocalBucketBuilder>
LockFreeBucket
).Constructor and Description |
---|
LocalBucketBuilder() |
Modifier and Type | Method and Description |
---|---|
Bucket |
build()
Constructs the bucket using
SynchronizationStrategy.LOCK_FREE synchronization strategy. |
Bucket |
build(SynchronizationStrategy synchronizationStrategy)
Constructs the new instance of local bucket which concrete type depends on synchronizationStrategy
|
LocalBucketBuilder |
withCustomTimePrecision(TimeMeter customTimeMeter)
Creates instance of
ConfigurationBuilder which will create buckets with customTimeMeter as time meter. |
LocalBucketBuilder |
withMillisecondPrecision()
Creates instance of
ConfigurationBuilder which will create buckets with TimeMeter.SYSTEM_MILLISECONDS as time meter. |
LocalBucketBuilder |
withNanosecondPrecision()
Creates instance of
ConfigurationBuilder which will create buckets with TimeMeter.SYSTEM_NANOTIME as time meter. |
addLimit, addLimit, buildConfiguration, toString
public LocalBucketBuilder withNanosecondPrecision()
ConfigurationBuilder
which will create buckets with TimeMeter.SYSTEM_NANOTIME
as time meter.public LocalBucketBuilder withMillisecondPrecision()
ConfigurationBuilder
which will create buckets with TimeMeter.SYSTEM_MILLISECONDS
as time meter.public LocalBucketBuilder withCustomTimePrecision(TimeMeter customTimeMeter)
ConfigurationBuilder
which will create buckets with customTimeMeter
as time meter.customTimeMeter
- object which will measure time.public Bucket build()
SynchronizationStrategy.LOCK_FREE
synchronization strategy.public Bucket build(SynchronizationStrategy synchronizationStrategy)
synchronizationStrategy
- the strategy of synchronization which need to be applied to prevent data-races in multithreading usage scenario.Copyright © 2017. All rights reserved.