Class Tasks

java.lang.Object
org.apache.camel.support.task.Tasks

public final class Tasks extends Object
A helper class for building tasks
  • Method Details

    • 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 builds
      Y - 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