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 TypeMethodDescriptionvoidCancel the task with given taskId.voidCleanup the task with the given taskId and remove it from the task service.getMessages(Long taskId) org.wicketstuff.progressbar.ProgressiongetProgression(Long taskId) Get the current progression of a task.Schedules the task, but doesn't start!scheduleAndStart(Task task) Schedule and start a task.voidStart the task with given taskId
-
Method Details
-
schedule
Schedules the task, but doesn't start!- Parameters:
task- The task to schedule- Returns:
- Generated ID of the task
-
start
Start the task with given taskId- Parameters:
taskId-
-
cancel
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
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
Schedule and start a task. Equal to:Long taskId = taskService.schedule(task); taskService.start(taskId);
- Parameters:
task-- Returns:
- taskId for this Task
-
getProgression
Get the current progression of a task.- Parameters:
taskId-- Returns:
- the current progression of a task.
-
getMessages
-