Interface TimeoutConfig
- All Superinterfaces:
Prototype.Api, Prototype.Factory<Timeout>
- All Known Implementing Classes:
TimeoutConfig.BuilderBase.TimeoutConfigImpl
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic classFluent API builder forTimeout.static classTimeoutConfig.BuilderBase<BUILDER extends TimeoutConfig.BuilderBase<BUILDER, PROTOTYPE>, PROTOTYPE extends TimeoutConfig>Fluent API builder base forTimeoutConfig. -
Method Summary
Modifier and TypeMethodDescriptionstatic TimeoutConfig.Builderbuilder()Create a new fluent API builder to customize configuration.static TimeoutConfig.Builderbuilder(TimeoutConfig instance) Create a new fluent API builder from an existing instance.static TimeoutConfigcreate()Create a new instance with default values.static TimeoutConfigCreate a new instance from configuration.booleanFlag to indicate that code must be executed in current thread instead of in an executor's thread.booleanFlag to enable metrics for this instance.executor()Executor service to schedule the timeout.name()Name for debugging, error reporting, monitoring.timeout()Duration to wait before timing out.Methods inherited from interface Prototype.Factory
build
-
Method Details
-
builder
Create a new fluent API builder to customize configuration.- Returns:
- a new builder
-
builder
Create a new fluent API builder from an existing instance.- Parameters:
instance- an existing instance used as a base for the builder- Returns:
- a builder based on an instance
-
create
Create a new instance from configuration.- Parameters:
config- used to configure the new instance- Returns:
- a new instance configured from configuration
-
create
-
name
-
timeout
-
currentThread
boolean currentThread()Flag to indicate that code must be executed in current thread instead of in an executor's thread. This flag isfalseby default.- Returns:
- whether to execute on current thread (
true), or in an executor service (false})
-
executor
Optional<ExecutorService> executor()Executor service to schedule the timeout.- Returns:
- executor service to use
-
enableMetrics
boolean enableMetrics()Flag to enable metrics for this instance. The value of this flag is combined with the global config entryFaultTolerance.FT_METRICS_DEFAULT_ENABLED. If either of these flags istrue, then metrics will be enabled for the instance.- Returns:
- metrics enabled flag
-