info.magnolia.module.delta
Class ConditionalDelegateTask
java.lang.Object
info.magnolia.module.delta.AbstractTask
info.magnolia.module.delta.ConditionalDelegateTask
- All Implemented Interfaces:
- Task
- Direct Known Subclasses:
- ChildrenExistsDelegateTask, IsInstallSamplesTask, NodeCheckDelegateTask, NodeExistsDelegateTask
public abstract class ConditionalDelegateTask
- extends AbstractTask
A task that delegates to another if a condition is true, or to an optional other if it is false.
TODO : get descriptions from delegate + a description of the condition ?
- Version:
- $Revision: $ ($Author: $)
- Author:
- gjoseph
Method Summary |
protected abstract boolean |
condition(InstallContext installContext)
|
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. |
ConditionalDelegateTask
protected ConditionalDelegateTask(String taskName,
String taskDescription,
Task ifTrue)
ConditionalDelegateTask
public ConditionalDelegateTask(String taskName,
String taskDescription,
Task ifTrue,
Task ifFalse)
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.
- Throws:
TaskExecutionException
condition
protected abstract boolean condition(InstallContext installContext)
throws TaskExecutionException
- Throws:
TaskExecutionException
Copyright © 2003–2014 Magnolia International Ltd.. All rights reserved.