org.wicketstuff.progressbar.spring
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
 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.
 List<Task.Message> getMessages(Long taskId)
           
 org.wicketstuff.progressbar.Progression getProgression(Long taskId)
          Get the current progression of a task.
 Long schedule(Task task)
          Schedules the task, but doesn't start!
 Long scheduleAndStart(Task task)
          Schedule and start a task.
 void start(Long taskId)
          Start the task with given taskId
 

Method Detail

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)


Copyright © 2007–2016. All rights reserved.