Class ThroughputLimitConfig.Builder
java.lang.Object
io.helidon.common.concurrency.limits.ThroughputLimitConfig.BuilderBase<ThroughputLimitConfig.Builder, ThroughputLimitConfig>
io.helidon.common.concurrency.limits.ThroughputLimitConfig.Builder
- All Implemented Interfaces:
Prototype.Builder<ThroughputLimitConfig.Builder, ThroughputLimitConfig>, Builder<ThroughputLimitConfig.Builder, ThroughputLimit>, ConfigBuilderSupport.ConfiguredBuilder<ThroughputLimitConfig.Builder, ThroughputLimitConfig>, Supplier<ThroughputLimit>
- Enclosing interface:
ThroughputLimitConfig
public static class ThroughputLimitConfig.Builder
extends ThroughputLimitConfig.BuilderBase<ThroughputLimitConfig.Builder, ThroughputLimitConfig>
implements Builder<ThroughputLimitConfig.Builder, ThroughputLimit>
Fluent API builder for
ThroughputLimit.-
Nested Class Summary
Nested classes/interfaces inherited from class ThroughputLimitConfig.BuilderBase
ThroughputLimitConfig.BuilderBase.ThroughputLimitConfigImplModifier and TypeClassDescriptionprotected static classGenerated implementation of the prototype, can be extended by descendant prototype implementations. -
Method Summary
Modifier and TypeMethodDescriptionbuild()Create an instance from this builder.Create an instance of the prototype.Methods inherited from class ThroughputLimitConfig.BuilderBase
amount, amount, clearClock, clearSemaphore, clock, clock, config, config, duration, duration, enableMetrics, enableMetrics, fair, fair, from, from, name, name, preBuildPrototype, queueLength, queueLength, queueTimeout, queueTimeout, rateLimitingAlgorithm, rateLimitingAlgorithm, semaphore, semaphore, toString, validatePrototypeModifier and TypeMethodDescriptionintamount()Number of operations to allow during the relevant time window.amount(int amount) Number of operations to allow during the relevant time window.Clear existing value of clock.Clear existing value of semaphore.clock()A clock that supplies nanosecond time.A clock that supplies nanosecond time.config()Configuration used to configure this instance.Update builder from configuration (node of this type).duration()Duration of the time window over which operations will be counted.Duration of the time window over which operations will be counted.booleanWhether to collect metrics for the throughput limit implementation.enableMetrics(boolean enableMetrics) Whether to collect metrics for the throughput limit implementation.booleanfair()Whether theSemaphoreshould beSemaphore.isFair().fair(boolean fair) Whether theSemaphoreshould beSemaphore.isFair().from(ThroughputLimitConfig prototype) Update this builder from an existing prototype instance.from(ThroughputLimitConfig.BuilderBase<?, ?> builder) Update this builder from an existing prototype builder instance.name()Name of this instance.Name of this instance.protected voidHandles providers and decorators.intHow many requests can be enqueued waiting for a permit.queueLength(int queueLength) How many requests can be enqueued waiting for a permit.How long to wait for a permit when enqueued.queueTimeout(Duration queueTimeout) How long to wait for a permit when enqueued.The rate limiting algorithm to apply.rateLimitingAlgorithm(RateLimitingAlgorithmType rateLimitingAlgorithm) The rate limiting algorithm to apply.Explicitly configured semaphore.Explicitly configured semaphore.toString()protected voidValidates required properties.Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface Builder
get, identity, updateModifier and TypeMethodDescriptiondefault ThroughputLimitget()default ThroughputLimitConfig.Builderidentity()Instance of this builder as the correct type.default ThroughputLimitConfig.Builderupdate(Consumer<ThroughputLimitConfig.Builder> consumer) Update the builder in a fluent API way.Methods inherited from interface Prototype.Builder
selfModifier and TypeMethodDescriptiondefault ThroughputLimitConfig.Builderself()Instance of this builder as the correct type.
-
Method Details
-
buildPrototype
Create an instance of the prototype. Calling this method may update this builder from providers and decorators, so repeated calls may have side effects.- Specified by:
buildPrototypein interfacePrototype.Builder<ThroughputLimitConfig.Builder, ThroughputLimitConfig>- Returns:
- an instance of the setup object created from this builder
-
build
Create an instance from this builder. Calling this method may update this builder from providers and decorators, so repeated calls may have side effects.- Specified by:
buildin interfaceBuilder<ThroughputLimitConfig.Builder, ThroughputLimit>- Returns:
- instance of the built type
-