Class FixedLimitConfig.BuilderBase.FixedLimitConfigImpl
java.lang.Object
io.helidon.common.concurrency.limits.FixedLimitConfig.BuilderBase.FixedLimitConfigImpl
- All Implemented Interfaces:
Prototype.Api
,Prototype.Factory<FixedLimit>
,FixedLimitConfig
,Supplier<FixedLimit>
- Enclosing class:
FixedLimitConfig.BuilderBase<BUILDER extends FixedLimitConfig.BuilderBase<BUILDER,
PROTOTYPE>, PROTOTYPE extends FixedLimitConfig>
protected static class FixedLimitConfig.BuilderBase.FixedLimitConfigImpl
extends Object
implements FixedLimitConfig, Supplier<FixedLimit>
Generated implementation of the prototype, can be extended by descendant prototype implementations.
-
Nested Class Summary
Nested classes/interfaces inherited from interface io.helidon.common.concurrency.limits.FixedLimitConfig
FixedLimitConfig.Builder, FixedLimitConfig.BuilderBase<BUILDER extends FixedLimitConfig.BuilderBase<BUILDER,
PROTOTYPE>, PROTOTYPE extends FixedLimitConfig> -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotected
FixedLimitConfigImpl
(FixedLimitConfig.BuilderBase<?, ?> builder) Create an instance providing a builder. -
Method Summary
Modifier and TypeMethodDescriptionbuild()
Create a new instance of the runtime type from this config object.clock()
A clock that supplies nanosecond time.boolean
Whether to collect metrics for the AIMD implementation.boolean
boolean
fair()
Whether theSemaphore
should beSemaphore.isFair()
.get()
int
hashCode()
name()
Name of this instance.int
permits()
Number of permit to allow.int
How many requests can be enqueued waiting for a permit.How long to wait for a permit when enqueued.Explicitly configured semaphore.toString()
-
Constructor Details
-
FixedLimitConfigImpl
Create an instance providing a builder.- Parameters:
builder
- extending builder base of this prototype
-
-
Method Details
-
build
Description copied from interface:Prototype.Factory
Create a new instance of the runtime type from this config object.- Specified by:
build
in interfacePrototype.Factory<FixedLimit>
- Returns:
- new configured runtime instance
-
get
- Specified by:
get
in interfaceSupplier<FixedLimit>
-
permits
public int permits()Description copied from interface:FixedLimitConfig
Number of permit to allow. Defaults to 0. When set to0
, we switch to unlimited.- Specified by:
permits
in interfaceFixedLimitConfig
- Returns:
- number of permits
-
fair
public boolean fair()Description copied from interface:FixedLimitConfig
- Specified by:
fair
in interfaceFixedLimitConfig
- Returns:
- whether this should be a fair semaphore
-
queueLength
public int queueLength()Description copied from interface:FixedLimitConfig
How many requests can be enqueued waiting for a permit. Note that this may not be an exact behavior due to concurrent invocations. We useSemaphore.getQueueLength()
in theFixedLimit
implementation. Default value is 0. If set to {code 0}, there is no queueing.- Specified by:
queueLength
in interfaceFixedLimitConfig
- Returns:
- number of requests to enqueue
-
queueTimeout
Description copied from interface:FixedLimitConfig
How long to wait for a permit when enqueued. Defaults to "PT1S"- Specified by:
queueTimeout
in interfaceFixedLimitConfig
- Returns:
- duration of the timeout
-
name
Description copied from interface:FixedLimitConfig
Name of this instance.- Specified by:
name
in interfaceFixedLimitConfig
- Returns:
- name of the instance
-
semaphore
Description copied from interface:FixedLimitConfig
Explicitly configured semaphore. Note that if this is set, all other configuration is ignored.- Specified by:
semaphore
in interfaceFixedLimitConfig
- Returns:
- semaphore instance
-
clock
Description copied from interface:FixedLimitConfig
A clock that supplies nanosecond time.- Specified by:
clock
in interfaceFixedLimitConfig
- Returns:
- supplier of current nanoseconds, defaults to
System.nanoTime()
-
enableMetrics
public boolean enableMetrics()Description copied from interface:FixedLimitConfig
Whether to collect metrics for the AIMD implementation.- Specified by:
enableMetrics
in interfaceFixedLimitConfig
- Returns:
- metrics flag
-
toString
-
equals
-
hashCode
public int hashCode()
-