public final class ExecutionContextBuilder
extends java.lang.Object
ExecutionContext
. If any of the components of ExecutionContext
is not provided, then
the corresponding component from GlobalExecutionContext
will be chosen. If none of the components are
provided then GlobalExecutionContext.globalExecutionContext()
will be returned.Constructor and Description |
---|
ExecutionContextBuilder()
New instance.
|
ExecutionContextBuilder(ExecutionContextBuilder other)
Copy constructor.
|
Modifier and Type | Method and Description |
---|---|
ExecutionContextBuilder |
bufferAllocator(BufferAllocator allocator)
Sets the
BufferAllocator to use. |
ExecutionContext |
build()
Builds a new
ExecutionContext or return GlobalExecutionContext.globalExecutionContext() if none
of the components are set in this builder. |
ExecutionContextBuilder |
executionStrategy(ExecutionStrategy strategy)
Sets the
ExecutionStrategy to use. |
ExecutionContextBuilder |
executor(Executor executor)
Sets the
Executor to use. |
ExecutionContextBuilder |
ioExecutor(IoExecutor ioExecutor)
Sets the
IoExecutor to use. |
public ExecutionContextBuilder()
public ExecutionContextBuilder(ExecutionContextBuilder other)
other
- existing ExecutionContextBuilder
to copy the config from.public ExecutionContextBuilder ioExecutor(IoExecutor ioExecutor)
IoExecutor
to use.ioExecutor
- IoExecutor
to use.this
.public ExecutionContextBuilder executor(Executor executor)
Executor
to use.executor
- Executor
to use.this
.public ExecutionContextBuilder bufferAllocator(BufferAllocator allocator)
BufferAllocator
to use.allocator
- BufferAllocator
to use.this
.public ExecutionContextBuilder executionStrategy(ExecutionStrategy strategy)
ExecutionStrategy
to use.strategy
- ExecutionStrategy
to use.this
.public ExecutionContext build()
ExecutionContext
or return GlobalExecutionContext.globalExecutionContext()
if none
of the components are set in this builder.ExecutionContext
.