info.magnolia.module.delta
Class ArrayDelegateTask

java.lang.Object
  extended by info.magnolia.module.delta.ArrayDelegateTask
All Implemented Interfaces:
Task
Direct Known Subclasses:
AddMailTemplateTask, BackupTask, BootstrapSingleResourceAndOrderBefore, ContentDeletionTasks, RegisterModuleServletsTask

public class ArrayDelegateTask
extends Object
implements Task

A task that simply delegates to an array of other tasks.

Version:
$Revision: $ ($Author: $)
Author:
gjoseph

Constructor Summary
ArrayDelegateTask(String name)
           
ArrayDelegateTask(String name, String description)
           
ArrayDelegateTask(String name, String description, Task... tasks)
           
ArrayDelegateTask(String name, String description, Task task1, Task task2)
          Since 4.2: replaced by the varargs constructor.
ArrayDelegateTask(String name, String description, Task task1, Task task2, Task task3)
          Since 4.2: replaced by the varargs constructor.
ArrayDelegateTask(String name, String description, Task task1, Task task2, Task task3, Task task4)
          Since 4.2: replaced by the varargs constructor.
ArrayDelegateTask(String name, Task... tasks)
           
ArrayDelegateTask(String name, Task task1, Task task2)
          Since 4.2: replaced by the varargs constructor.
ArrayDelegateTask(String name, Task task1, Task task2, Task task3)
          Since 4.2: replaced by the varargs constructor.
ArrayDelegateTask(String name, Task task1, Task task2, Task task3, Task task4)
          Since 4.2: replaced by the varargs constructor.
 
Method Summary
 void addTask(Task task)
          Tasks are meant to be immutable.
 void execute(InstallContext ctx)
          A good-citizen task should execute itself responsibly: it should know what to do in case of problems: for instance, fixable or irrelevant issues should usually just be logged used the InstallContext methods, when the user can fix them later on.
 String getDescription()
          Description what will happen during the execution.
 String getName()
          Description of what has changed.
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ArrayDelegateTask

public ArrayDelegateTask(String name)

ArrayDelegateTask

public ArrayDelegateTask(String name,
                         String description)

ArrayDelegateTask

public ArrayDelegateTask(String name,
                         Task... tasks)

ArrayDelegateTask

public ArrayDelegateTask(String name,
                         String description,
                         Task... tasks)

ArrayDelegateTask

public ArrayDelegateTask(String name,
                         Task task1,
                         Task task2)
Since 4.2: replaced by the varargs constructor. Informally deprecated; will be removed in 4.3.


ArrayDelegateTask

public ArrayDelegateTask(String name,
                         String description,
                         Task task1,
                         Task task2)
Since 4.2: replaced by the varargs constructor. Informally deprecated; will be removed in 4.3.


ArrayDelegateTask

public ArrayDelegateTask(String name,
                         Task task1,
                         Task task2,
                         Task task3)
Since 4.2: replaced by the varargs constructor. Informally deprecated; will be removed in 4.3.


ArrayDelegateTask

public ArrayDelegateTask(String name,
                         String description,
                         Task task1,
                         Task task2,
                         Task task3)
Since 4.2: replaced by the varargs constructor. Informally deprecated; will be removed in 4.3.


ArrayDelegateTask

public ArrayDelegateTask(String name,
                         Task task1,
                         Task task2,
                         Task task3,
                         Task task4)
Since 4.2: replaced by the varargs constructor. Informally deprecated; will be removed in 4.3.


ArrayDelegateTask

public ArrayDelegateTask(String name,
                         String description,
                         Task task1,
                         Task task2,
                         Task task3,
                         Task task4)
Since 4.2: replaced by the varargs constructor. Informally deprecated; will be removed in 4.3.

Method Detail

getName

public String getName()
Description copied from interface: Task
Description of what has changed. Example: "New ACL configuration"

Specified by:
getName in interface Task

addTask

public void addTask(Task task)
Tasks are meant to be immutable. Avoid this if possible.


getDescription

public String getDescription()
Description copied from interface: Task
Description what will happen during the execution. Example: "Bootstraps the new configuration for the ACL dialogs." A good-citizen task description should be written in the third person, be understandable and respect capitalization and punctuation rules. (start with capital letter, end with a dot)

Specified by:
getDescription in interface Task

execute

public void execute(InstallContext ctx)
             throws TaskExecutionException
Description copied from interface: Task
A good-citizen task should execute itself responsibly: it should know what to do in case of problems: for instance, fixable or irrelevant issues should usually just be logged used the InstallContext methods, when the user can fix them later on. The task could also potentially do backups of nodes it needs to modify extensively, so the user could refer to the backups in case of problem. In the event of an unrecoverable issue, the Task could also throw a TaskExecutionException, knowing that will cancel the whole module's installation, update and startup. If a TaskExecutionException must be thrown, keep in mind that the exception message will still be shown to the end user, so try to keep them human readable.

Specified by:
execute in interface Task
Throws:
TaskExecutionException

toString

public String toString()
Overrides:
toString in class Object


Copyright © 2003-2012 Magnolia International Ltd.. All Rights Reserved.