net.chaosserver.bilbo.task
Class CompositeTask

java.lang.Object
  |
  +--net.chaosserver.bilbo.task.BaseTask
        |
        +--net.chaosserver.bilbo.task.CompositeTask
All Implemented Interfaces:
Task
Direct Known Subclasses:
AndurilTask, BackAgainTask, ThereTask

public abstract class CompositeTask
extends BaseTask

This is a task made up of other tasks.

It will execute each subtask in order.

Since:
Bilbo 2.0

Nested Class Summary
protected  class CompositeTask.SubTask
          Subtask objects held inside the taskList.
 
Field Summary
protected  List taskList
          List of tasks to be executed.
 
Fields inherited from class net.chaosserver.bilbo.task.BaseTask
settings
 
Constructor Summary
protected CompositeTask()
          Default contructor.
 
Method Summary
protected  void addTask(String taskName)
          Adds a task without arguments.
protected  void addTask(String taskName, String taskArguments)
          Adds a task into the task list.
 void executeSpecific()
          Executes each task in the task list.
 void parseTaskArguments(String argumentString)
          Does nothing.
protected abstract  void setUp()
          Called at the start of executeSpecific to add subtasks.
 
Methods inherited from class net.chaosserver.bilbo.task.BaseTask
execute, getHelpResource, getSettings, printHelp, setSettings
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

taskList

protected List taskList
List of tasks to be executed.

Constructor Detail

CompositeTask

protected CompositeTask()
Default contructor.

Method Detail

parseTaskArguments

public void parseTaskArguments(String argumentString)
Does nothing.

Specified by:
parseTaskArguments in interface Task
Overrides:
parseTaskArguments in class BaseTask
Parameters:
argumentString - string of arguments for this task

executeSpecific

public void executeSpecific()
                     throws TaskException
Executes each task in the task list.

Specified by:
executeSpecific in class BaseTask
Throws:
TaskException - if the sub tasks encounter and error

setUp

protected abstract void setUp()
                       throws TaskException
Called at the start of executeSpecific to add subtasks.

Concrete subclasses must over-ride this and should use it to make calls to addTask to add tasks into the parent.

Throws:
TaskException - if a child class wants to break

addTask

protected void addTask(String taskName,
                       String taskArguments)
Adds a task into the task list.

Parameters:
taskName - the name of the task to add
taskArguments - the argument string to give the task

addTask

protected void addTask(String taskName)
Adds a task without arguments.

Parameters:
taskName - the name of the task to add


Copyright © 20030415