Class TaskService
java.lang.Object
org.wicketstuff.progressbar.spring.TaskService
- All Implemented Interfaces:
ITaskService
Should be registered as SESSION scoped bean to prevent memory leaks with unfinished tasks.
TODO automatic cleanup of tasks- Author:
- Christopher Hlubek (hlubek)
-
Constructor Summary
Constructors -
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
-
Constructor Details
-
TaskService
-
-
Method Details
-
schedule
Description copied from interface:ITaskServiceSchedules the task, but doesn't start!- Specified by:
schedulein interfaceITaskService- Parameters:
task- The task to schedule- Returns:
- Generated ID of the task
-
start
Description copied from interface:ITaskServiceStart the task with given taskId- Specified by:
startin interfaceITaskService
-
cancel
Description copied from interface:ITaskServiceCancel the task with given taskId. The task itself is responsible for stopping, so this should be considered as some type of "soft interrupt".- Specified by:
cancelin interfaceITaskService
-
scheduleAndStart
Description copied from interface:ITaskServiceSchedule and start a task. Equal to:Long taskId = taskService.schedule(task); taskService.start(taskId);
- Specified by:
scheduleAndStartin interfaceITaskService- Returns:
- taskId for this Task
-
finish
Description copied from interface:ITaskServiceCleanup 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.- Specified by:
finishin interfaceITaskService
-
getProgression
Description copied from interface:ITaskServiceGet the current progression of a task.- Specified by:
getProgressionin interfaceITaskService- Returns:
- the current progression of a task.
-
getMessages
- Specified by:
getMessagesin interfaceITaskService
-