TYPE - the configurable object type.public static final class InvocationConfiguration.Builder<TYPE> extends Object
| Constructor and Description |
|---|
InvocationConfiguration.Builder(InvocationConfiguration.Configurable<? extends TYPE> configurable)
Constructor.
|
InvocationConfiguration.Builder(InvocationConfiguration.Configurable<? extends TYPE> configurable,
InvocationConfiguration initialConfiguration)
Constructor.
|
| Modifier and Type | Method and Description |
|---|---|
TYPE |
set()
Sets the configuration and returns the configurable object.
|
InvocationConfiguration.Builder<TYPE> |
with(InvocationConfiguration configuration)
Applies the specified configuration to this builder.
|
InvocationConfiguration.Builder<TYPE> |
withCoreInstances(int coreInstances)
Sets the number of invocation instances, which represents the core pool of reusable
invocations.
|
InvocationConfiguration.Builder<TYPE> |
withInputMaxSize(int inputMaxSize)
Sets the maximum number of data that the input channel can retain before they are
consumed.
|
InvocationConfiguration.Builder<TYPE> |
withInputOrder(InvocationConfiguration.OrderType orderType)
Sets the order in which input data are collected from the input channel.
|
InvocationConfiguration.Builder<TYPE> |
withInputTimeout(long timeout,
TimeUnit timeUnit)
Sets the timeout for an input channel to have room for additional data.
|
InvocationConfiguration.Builder<TYPE> |
withInputTimeout(TimeDuration timeout)
Sets the timeout for an input channel to have room for additional data.
|
InvocationConfiguration.Builder<TYPE> |
withLog(Log log)
Sets the log instance.
|
InvocationConfiguration.Builder<TYPE> |
withLogLevel(Log.Level level)
Sets the log level.
|
InvocationConfiguration.Builder<TYPE> |
withMaxInstances(int maxInstances)
Sets the max number of concurrently running invocation instances.
|
InvocationConfiguration.Builder<TYPE> |
withOutputMaxSize(int outputMaxSize)
Sets the maximum number of data that the result channel can retain before they are
consumed.
|
InvocationConfiguration.Builder<TYPE> |
withOutputOrder(InvocationConfiguration.OrderType orderType)
Sets the order in which output data are collected from the result channel.
|
InvocationConfiguration.Builder<TYPE> |
withOutputTimeout(long timeout,
TimeUnit timeUnit)
Sets the timeout for a result channel to have room for additional data.
|
InvocationConfiguration.Builder<TYPE> |
withOutputTimeout(TimeDuration timeout)
Sets the timeout for a result channel to have room for additional data.
|
InvocationConfiguration.Builder<TYPE> |
withPriority(int priority)
Sets the invocation priority.
|
InvocationConfiguration.Builder<TYPE> |
withReadTimeout(long timeout,
TimeUnit timeUnit)
Sets the timeout for an invocation instance to produce a readable result.
Note that this is just the initial configuration of the invocation, since the output timeout can be dynamically changed through the dedicated methods. |
InvocationConfiguration.Builder<TYPE> |
withReadTimeout(TimeDuration timeout)
Sets the timeout for an invocation instance to produce a readable result.
|
InvocationConfiguration.Builder<TYPE> |
withReadTimeoutAction(InvocationConfiguration.TimeoutActionType actionType)
Sets the action to be taken if the timeout elapses before a result can be read from the
output channel.
|
InvocationConfiguration.Builder<TYPE> |
withRunner(Runner runner)
Sets the asynchronous runner instance.
|
public InvocationConfiguration.Builder(@NotNull
InvocationConfiguration.Configurable<? extends TYPE> configurable)
configurable - the configurable instance.public InvocationConfiguration.Builder(@NotNull
InvocationConfiguration.Configurable<? extends TYPE> configurable,
@NotNull
InvocationConfiguration initialConfiguration)
configurable - the configurable instance.initialConfiguration - the initial configuration.@NotNull public TYPE set()
@NotNull public InvocationConfiguration.Builder<TYPE> with(@Nullable InvocationConfiguration configuration)
configuration - the invocation configuration.@NotNull public InvocationConfiguration.Builder<TYPE> withCoreInstances(int coreInstances)
DEFAULT value means that it is
up to the specific implementation to choose a default one.coreInstances - the core number of instances.IllegalArgumentException - if the number is negative.@NotNull public InvocationConfiguration.Builder<TYPE> withInputMaxSize(int inputMaxSize)
DEFAULT value means that it is up
to the specific implementation to choose a default one.inputMaxSize - the maximum size.IllegalArgumentException - if the number is less than 1.@NotNull public InvocationConfiguration.Builder<TYPE> withInputOrder(@Nullable InvocationConfiguration.OrderType orderType)
orderType - the order type.@NotNull public InvocationConfiguration.Builder<TYPE> withInputTimeout(long timeout, @NotNull TimeUnit timeUnit)
timeout - the timeout.timeUnit - the timeout time unit.IllegalArgumentException - if the specified timeout is negative.@NotNull public InvocationConfiguration.Builder<TYPE> withInputTimeout(@Nullable TimeDuration timeout)
timeout - the timeout.@NotNull public InvocationConfiguration.Builder<TYPE> withLog(@Nullable Log log)
log - the log instance.@NotNull public InvocationConfiguration.Builder<TYPE> withLogLevel(@Nullable Log.Level level)
level - the log level.@NotNull public InvocationConfiguration.Builder<TYPE> withMaxInstances(int maxInstances)
DEFAULT value means that it is up to the
specific implementation to choose a default one.maxInstances - the max number of instances.IllegalArgumentException - if the number is less than 1.@NotNull public InvocationConfiguration.Builder<TYPE> withOutputMaxSize(int outputMaxSize)
DEFAULT value means that it is up
to the specific implementation to choose a default one.outputMaxSize - the maximum size.IllegalArgumentException - if the number is less than 1.@NotNull public InvocationConfiguration.Builder<TYPE> withOutputOrder(@Nullable InvocationConfiguration.OrderType orderType)
orderType - the order type.@NotNull public InvocationConfiguration.Builder<TYPE> withOutputTimeout(long timeout, @NotNull TimeUnit timeUnit)
timeout - the timeout.timeUnit - the timeout time unit.IllegalArgumentException - if the specified timeout is negative.@NotNull public InvocationConfiguration.Builder<TYPE> withOutputTimeout(@Nullable TimeDuration timeout)
timeout - the timeout.@NotNull public InvocationConfiguration.Builder<TYPE> withPriority(int priority)
DEFAULT value
means that the invocations will be executed with no specific priority.priority - the priority.PriorityRunner@NotNull public InvocationConfiguration.Builder<TYPE> withReadTimeout(long timeout, @NotNull TimeUnit timeUnit)
timeout - the timeout.timeUnit - the timeout time unit.IllegalArgumentException - if the specified timeout is negative.@NotNull public InvocationConfiguration.Builder<TYPE> withReadTimeout(@Nullable TimeDuration timeout)
timeout - the timeout.@NotNull public InvocationConfiguration.Builder<TYPE> withReadTimeoutAction(@Nullable InvocationConfiguration.TimeoutActionType actionType)
actionType - the action type.@NotNull public InvocationConfiguration.Builder<TYPE> withRunner(@Nullable Runner runner)
runner - the runner instance.