Nested Class Summary
Nested Classes
static class
static class
Fluent API builder base for
Timeout
.
Method Summary
All Methods Static Methods Instance Methods Abstract Methods
Create a new fluent API builder to customize configuration.
Create a new fluent API builder from an existing instance.
Create a new instance with default values.
Create a new instance from configuration.
boolean
Flag to indicate that code must be executed in current thread instead
of in an executor's thread.
boolean
Flag to enable metrics for this instance.
Executor service to schedule the timeout.
Name for debugging, error reporting, monitoring.
Duration to wait before timing out.
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
Create a new instance with default values.
Returns:
a new instance
name
Name for debugging, error reporting, monitoring.
Returns:
name of this timeout
timeout
Duration to wait before timing out.
Defaults to 10 seconds
.
Returns:
timeout
currentThread
boolean currentThread ()
Flag to indicate that code must be executed in current thread instead
of in an executor's thread. This flag is false
by default.
Returns:
whether to execute on current thread (true
), or in an executor service (false
})
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 entry
FaultTolerance.FT_METRICS_DEFAULT_ENABLED
.
If either of these flags is
true
, then metrics will be enabled
for the instance.
Returns:
metrics enabled flag