Package org.apache.camel.support.task
Class Tasks
- java.lang.Object
-
- org.apache.camel.support.task.Tasks
-
public final class Tasks extends Object
A helper class for building tasks
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static BackgroundTask.BackgroundTaskBuilder
backgroundTask()
Creates a new background task builderstatic ForegroundTask.ForegroundTaskBuilder
foregroundTask()
Creates a new foreground task builderstatic <T extends BlockingTask,Y extends TaskBuilder<T>>
Ytask(Supplier<Y> taskBuilderSupplier)
A generic builder for task builders
-
-
-
Method Detail
-
backgroundTask
public static BackgroundTask.BackgroundTaskBuilder backgroundTask()
Creates a new background task builder- Returns:
- an instance of a background task builder
-
foregroundTask
public static ForegroundTask.ForegroundTaskBuilder foregroundTask()
Creates a new foreground task builder- Returns:
- an instance of a foreground task builder
-
task
public static <T extends BlockingTask,Y extends TaskBuilder<T>> Y task(Supplier<Y> taskBuilderSupplier)
A generic builder for task builders- Type Parameters:
T
- the type of tasks that the builder buildsY
- the type of the task builder to provide- Parameters:
taskBuilderSupplier
- A supplier of tasks (usually a parameterless constructor in the form of Builder::new)- Returns:
- A new instance of the given task builder
-
-