Package org.apache.camel.support.task
Class Tasks
java.lang.Object
org.apache.camel.support.task.Tasks
A helper class for building tasks
-
Method Summary
Modifier and TypeMethodDescriptionCreates a new background task builderCreates a new foreground task builderstatic <T extends BlockingTask,
Y extends TaskBuilder<T>>
YA generic builder for task builders
-
Method Details
-
backgroundTask
Creates a new background task builder- Returns:
- an instance of a background task builder
-
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
-