-
Nested Class Summary
Nested Classes
static class
static class
Fluent API builder base for
Timeout
.
-
Method Summary
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.
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