public class SchedulerConfig extends Object
Scheduler obtained through the SchedulerService.| Modifier and Type | Method and Description |
|---|---|
static SchedulerConfig |
config() |
Integer |
getMaxConcurrentTasks() |
String |
getSchedulerName() |
Supplier<Long> |
getShutdownTimeoutMillis() |
Optional<Boolean> |
getWaitAllowed() |
boolean |
hasName() |
SchedulerConfig |
withMaxConcurrentTasks(int maxConcurrentTasks)
Sets the max tasks that can be run at the same time for the target
Scheduler. |
SchedulerConfig |
withName(String schedulerName)
Sets the name for the target
Scheduler, which will override the default one. |
SchedulerConfig |
withPrefix(String schedulerPrefix)
Sets the prefix to prepend to the name for the target
Scheduler, which will override the default one. |
SchedulerConfig |
withShutdownTimeout(long shutdownTimeout,
TimeUnit shutdownTimeoutUnit)
Sets the graceful shutdown timeout to use when stopping the target
Scheduler. |
SchedulerConfig |
withShutdownTimeout(Supplier<Long> shutdownTimeoutSupplier,
TimeUnit shutdownTimeoutUnit)
Sets the graceful shutdown timeout to use when stopping the target
Scheduler. |
SchedulerConfig |
withWaitAllowed(boolean waitAllowed)
Whether the threads of the target custom
Scheduler may block to wait when dispatching to a busy Scheduler. |
public static SchedulerConfig config()
public SchedulerConfig withMaxConcurrentTasks(int maxConcurrentTasks)
Scheduler.
This is useful to apply throttling on the target Scheduler. The way exceeding tasks will be handled is determined by
the target Scheduler.
maxConcurrentTasks - how many tasks can be running at the same time for the target Scheduler.public Integer getMaxConcurrentTasks()
Scheduler.public SchedulerConfig withPrefix(String schedulerPrefix)
Scheduler, which will override the default one.schedulerPrefix - the prefix for the name for the target Scheduler.public SchedulerConfig withName(String schedulerName)
Scheduler, which will override the default one.schedulerName - the name for the target Scheduler.public String getSchedulerName()
Scheduler.public boolean hasName()
true if withName(String) was called with a non-null value, false otherwise.public SchedulerConfig withWaitAllowed(boolean waitAllowed)
Scheduler may block to wait when dispatching to a busy Scheduler.
This is only applicable for custom Schedulers. This behaviour cannot be changed for the runtime managed
Scheduler.
public Optional<Boolean> getWaitAllowed()
Scheduler may block to wait when dispatching to a busy
Scheduler.public SchedulerConfig withShutdownTimeout(Supplier<Long> shutdownTimeoutSupplier, TimeUnit shutdownTimeoutUnit)
Scheduler.shutdownTimeoutSupplier - a supplier of the value of the timeout to use when gracefully stopping the target
Scheduler, expressed in the provided TimeUnit.shutdownTimeoutUnit - the unit of the timeout to use when gracefully stopping the target Scheduler.public SchedulerConfig withShutdownTimeout(long shutdownTimeout, TimeUnit shutdownTimeoutUnit)
Scheduler.shutdownTimeout - the value of the timeout to use when gracefully stopping the target Scheduler, expressed in
the provided TimeUnit.shutdownTimeoutUnit - the unit of the timeout to use when gracefully stopping the target Scheduler.Copyright © 2003–2017 MuleSoft, Inc.. All rights reserved.