public class DefaultTaskGraphExecuter extends Object implements TaskGraphExecuter
| Constructor and Description |
|---|
DefaultTaskGraphExecuter(ListenerManager listenerManager) |
| Modifier and Type | Method and Description |
|---|---|
void |
addTaskExecutionGraphListener(TaskExecutionGraphListener listener)
Adds a listener to this graph, to be notified when this graph is ready.
|
void |
addTaskExecutionListener(TaskExecutionListener listener)
Adds a listener to this graph, to be notified as tasks are executed.
|
void |
addTasks(Iterable<? extends Task> tasks)
Adds the given tasks and their dependencies to this graph.
|
void |
afterTask(Closure closure)
Adds a closure to be called immediately after a task has executed.
|
void |
beforeTask(Closure closure)
Adds a closure to be called immediately before a task is executed.
|
void |
execute()
Executes the tasks in this graph.
|
void |
execute(Iterable<? extends Task> tasks) |
List<Task> |
getAllTasks()
Returns the tasks which are included in the execution plan.
|
boolean |
hasTask(String path)
Determines whether the given task is included in the execution plan.
|
boolean |
hasTask(Task task)
Determines whether the given task is included in the execution plan.
|
void |
removeTaskExecutionGraphListener(TaskExecutionGraphListener listener)
Remove a listener from this graph.
|
void |
removeTaskExecutionListener(TaskExecutionListener listener)
Remove a listener from this graph.
|
void |
useFailureHandler(TaskFailureHandler handler)
Sets the handler to use when a task fails.
|
void |
useFilter(Spec<? super Task> filter)
Sets the filter to use when adding tasks to this graph.
|
void |
whenReady(Closure closure)
Adds a closure to be called when this graph has been populated.
|
public DefaultTaskGraphExecuter(ListenerManager listenerManager)
public void useFilter(Spec<? super Task> filter)
TaskGraphExecuteruseFilter in interface TaskGraphExecuterpublic void addTasks(Iterable<? extends Task> tasks)
TaskGraphExecuteraddTasks in interface TaskGraphExecuterpublic void execute()
TaskGraphExecuterexecute in interface TaskGraphExecuterpublic void addTaskExecutionGraphListener(TaskExecutionGraphListener listener)
TaskExecutionGraphAdds a listener to this graph, to be notified when this graph is ready.
addTaskExecutionGraphListener in interface TaskExecutionGraphlistener - The listener to add. Does nothing if this listener has already been added.public void removeTaskExecutionGraphListener(TaskExecutionGraphListener listener)
TaskExecutionGraphRemove a listener from this graph.
removeTaskExecutionGraphListener in interface TaskExecutionGraphlistener - The listener to remove. Does nothing if this listener was never added to this graph.public void whenReady(Closure closure)
TaskExecutionGraphAdds a closure to be called when this graph has been populated. This graph is passed to the closure as a parameter.
whenReady in interface TaskExecutionGraphclosure - The closure to execute when this graph has been populated.public void addTaskExecutionListener(TaskExecutionListener listener)
TaskExecutionGraphAdds a listener to this graph, to be notified as tasks are executed.
addTaskExecutionListener in interface TaskExecutionGraphlistener - The listener to add. Does nothing if this listener has already been added.public void removeTaskExecutionListener(TaskExecutionListener listener)
TaskExecutionGraphRemove a listener from this graph.
removeTaskExecutionListener in interface TaskExecutionGraphlistener - The listener to remove. Does nothing if this listener was never added to this graph.public void beforeTask(Closure closure)
TaskExecutionGraphAdds a closure to be called immediately before a task is executed. The task is passed to the closure as a parameter.
beforeTask in interface TaskExecutionGraphclosure - The closure to execute when a task is about to be executed.public void afterTask(Closure closure)
TaskExecutionGraphAdds a closure to be called immediately after a task has executed. The task is passed to the closure as the
first parameter. A TaskState is passed as the second parameter. Both parameters are
optional.
afterTask in interface TaskExecutionGraphclosure - The closure to execute when a task has been executedpublic void useFailureHandler(TaskFailureHandler handler)
TaskGraphExecuteruseFailureHandler in interface TaskGraphExecuterpublic boolean hasTask(Task task)
TaskExecutionGraphDetermines whether the given task is included in the execution plan.
hasTask in interface TaskExecutionGraphtask - the taskpublic boolean hasTask(String path)
TaskExecutionGraphDetermines whether the given task is included in the execution plan.
hasTask in interface TaskExecutionGraphpath - the absolute path of the task.public List<Task> getAllTasks()
TaskExecutionGraphReturns the tasks which are included in the execution plan. The tasks are returned in the order that they will be executed.
getAllTasks in interface TaskExecutionGraphCopyright © 2013. All rights reserved