org.schmant.task.meta
Class RecursiveActionTask

java.lang.Object
  extended by org.schmant.support.AbstractArgumentChecker
      extended by org.schmant.task.stub.AbstractTask<T>
          extended by org.schmant.task.stub.AbstractActionTask<T>
              extended by org.schmant.task.stub.AbstractCallbackRecursiveActionTask<RecursiveActionTask>
                  extended by org.schmant.task.meta.RecursiveActionTask
All Implemented Interfaces:
TaskDependency, ActionTaskConfigurable<RecursiveActionTask>, ActionTaskSpec<RecursiveActionTask>, LoggingConfigurable<RecursiveActionTask>, SourceConfigurable<RecursiveActionTask>, SourceConfigured, RecursiveActionTaskConfigurable<RecursiveActionTask>, RecursiveActionTaskSpec<RecursiveActionTask>, Task, TaskRunnable, TaskSpecification<RecursiveActionTask>

public final class RecursiveActionTask
extends AbstractCallbackRecursiveActionTask<RecursiveActionTask>

See RecursiveActionTF

Since:
0.5
Author:
Karl Gustafsson
Task_package:
org.schmant.task.base

Method Summary
protected  void callback(Report r, EntityView ev, RelativeLocation rel)
          This method is called for each entity returned when iterating over the sources.
 void copyProperties(RecursiveActionTask spec)
          Override the implementation from AbstractTask to copy the source properties.
 TaskDependency getDependencyForTasksScheduledByThisTask()
          This implementation returns this.
protected  void runTask(Report r, Task t)
           
 String toString()
          Default implementation for tasks.
protected  Collection<String> validate(Report r)
          Override the method inherited from AbstractTask to give a validation error if no source is set (and AbstractActionTask.isSourcesMandatory() is true).
 
Methods inherited from class org.schmant.task.stub.AbstractCallbackRecursiveActionTask
isDisableHeaderLogging, isMoreThanOneSourceAllowed, runInternal, setDepthFirstIterator, setDisableHeaderLogging
 
Methods inherited from class org.schmant.task.stub.AbstractActionTask
addSource, addSources, clearSources, getRelativeToBase, getSource, getSources, isSourcesMandatory, setRelativeToBase, setSource, setSources
 
Methods inherited from class org.schmant.task.stub.AbstractTask
cancel, createTask, getDefaultLogFooter, getDefaultLogHeader, getDependencyObservable, getFailureCause, getLogFooter, getLogHeader, getSatisfiedStateLock, getThis, isCancelled, isDone, isInterrupted, isRunning, isSatisfied, isSuccessful, run, setLogFooter, setLogHeader, setReportLevel, setTraceLogging
 
Methods inherited from class org.schmant.support.AbstractArgumentChecker
check, check, check, check
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.schmant.task.TaskSpecification
createTask
 
Methods inherited from interface org.schmant.task.confable.LoggingConfigurable
setLogFooter, setLogHeader, setReportLevel, setTraceLogging
 
Methods inherited from interface org.schmant.task.confable.SourceConfigured
getSource, getSources
 
Methods inherited from interface org.schmant.task.confable.SourceConfigurable
addSource, addSources, clearSources, setRelativeToBase, setSource, setSources
 

Method Detail

runTask

protected void runTask(Report r,
                       Task t)

validate

protected Collection<String> validate(Report r)
Description copied from class: AbstractActionTask
Override the method inherited from AbstractTask to give a validation error if no source is set (and AbstractActionTask.isSourcesMandatory() is true).

Subclasses may override this to add their own validations.

Overrides:
validate in class AbstractActionTask<RecursiveActionTask>
Parameters:
r - A report to log warning and debug messages to. Validation errors should not be logged, though. They are logged later.
Returns:
A collection of error messages.

callback

protected void callback(Report r,
                        EntityView ev,
                        RelativeLocation rel)
Description copied from class: AbstractCallbackRecursiveActionTask
This method is called for each entity returned when iterating over the sources.

Specified by:
callback in class AbstractCallbackRecursiveActionTask<RecursiveActionTask>
Parameters:
r - The current report.
ev - The entity.
rel - The entity's location, relative to the source it was returned from. If the source object was a file, the relative location is the file's name.

getDependencyForTasksScheduledByThisTask

public TaskDependency getDependencyForTasksScheduledByThisTask()
Description copied from class: AbstractTask
This implementation returns this. Subclasses that use TaskExecutor:s must override this method to return a dependency object for all of its scheduled tasks.

Specified by:
getDependencyForTasksScheduledByThisTask in interface Task
Overrides:
getDependencyForTasksScheduledByThisTask in class AbstractTask<RecursiveActionTask>
Returns:
this

copyProperties

public void copyProperties(RecursiveActionTask spec)
Description copied from class: AbstractActionTask
Override the implementation from AbstractTask to copy the source properties. Subclasses must override this to copy their own properties.

Specified by:
copyProperties in interface TaskSpecification<RecursiveActionTask>
Overrides:
copyProperties in class AbstractCallbackRecursiveActionTask<RecursiveActionTask>
Parameters:
spec - The specification to copy properties to.

toString

public String toString()
Description copied from class: AbstractTask
Default implementation for tasks. Task implementations may override this. It is used in the default log header that is written (level INFO) before a task is run.

This implementation just returns the class name.

Overrides:
toString in class AbstractActionTask<RecursiveActionTask>