Groovy Documentation

griffon.plugins.tasks
[Java] Interface TaskManager


public interface TaskManager

Authors:
Eike Kettner
Since:
19.07.11 22:16


Method Summary
TaskControl create(Task task)

Creates a new TaskControl for a given task.

TaskControl findTask(TaskPredicate predicate)

TaskControl getTask(String contextId)

Looks up a task by the specified context id.

TaskListenerSupport getTaskListenerSupport()

Allows to add listeners.

Iterable getTasks(TaskPredicate predicate)

Returns a collection of all currently created task conforming to the specified predicate.

Future submit(Runnable task)

Submits a Runnable object for execution.

Future submit(Callable task)

Submits a Callable object for execution.

 

Method Detail

create

public TaskControl create(Task task)
Creates a new TaskControl for a given task. The state is set to State.PENDING and the task is not started. That allows to add listeners for this task execution before starting it.

Tasks created by this method will fire TaskEvents as appropriate. See TaskListener for details.

Parameters:
task
Returns:


findTask

public TaskControl findTask(TaskPredicate predicate)


getTask

public TaskControl getTask(String contextId)
Looks up a task by the specified context id.
Parameters:
contextId
Returns:


getTaskListenerSupport

public TaskListenerSupport getTaskListenerSupport()
Allows to add listeners.
Returns:


getTasks

public Iterable getTasks(TaskPredicate predicate)
Returns a collection of all currently created task conforming to the specified predicate. The contract is to have all started and pending tasks available. It's not necessary returning finished tasks.
Parameters:
predicate
Returns:


submit

public Future submit(Runnable task)
Submits a Runnable object for execution. Contrary to executing Tasks this is more lightweight as it does not fire any events and is not managed by this manager.
Parameters:
task
Returns:


submit

public Future submit(Callable task)
Submits a Callable object for execution. Contrary to executing Tasks this is more lightweight as it does not fire any events and is not managed by this manager.
Parameters:
task
Returns:


 

Groovy Documentation