Interface ITaskService

All Known Implementing Classes:
TaskService

public interface ITaskService
The task should always be referenced with the taskId in the Wicket page, so there is no public getTask(...) method!
Author:
Christopher Hlubek (hlubek)
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    cancel(Long taskId)
    Cancel the task with given taskId.
    void
    finish(Long taskId)
    Cleanup the task with the given taskId and remove it from the task service.
    getMessages(Long taskId)
     
    org.wicketstuff.progressbar.Progression
    Get the current progression of a task.
    schedule(Task task)
    Schedules the task, but doesn't start!
    Schedule and start a task.
    void
    start(Long taskId)
    Start the task with given taskId
  • Method Details

    • schedule

      Long schedule(Task task)
      Schedules the task, but doesn't start!
      Parameters:
      task - The task to schedule
      Returns:
      Generated ID of the task
    • start

      void start(Long taskId)
      Start the task with given taskId
      Parameters:
      taskId -
    • cancel

      void cancel(Long taskId)
      Cancel the task with given taskId. The task itself is responsible for stopping, so this should be considered as some type of "soft interrupt".
      Parameters:
      taskId -
    • finish

      void finish(Long taskId)
      Cleanup the task with the given taskId and remove it from the task service. Should always be called to free the task and prevent memory leaks! Since this not really safe to do from a web page AJAX callback, you should always register the TaskService as a SESSION bean.
      Parameters:
      taskId -
    • scheduleAndStart

      Long scheduleAndStart(Task task)
      Schedule and start a task. Equal to:
       Long taskId = taskService.schedule(task);
       taskService.start(taskId);
       
      Parameters:
      task -
      Returns:
      taskId for this Task
    • getProgression

      org.wicketstuff.progressbar.Progression getProgression(Long taskId)
      Get the current progression of a task.
      Parameters:
      taskId -
      Returns:
      the current progression of a task.
    • getMessages

      List<Task.Message> getMessages(Long taskId)