|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.schmant.support.AbstractArgumentChecker
org.schmant.task.stub.AbstractTask<T>
org.schmant.task.stub.AbstractActionTask<T>
org.schmant.task.stub.AbstractProcessTask<ClosureTask>
org.schmant.task.lang.ClosureTask
public final class ClosureTask
This task is used by other tasks that run closures.
Field Summary |
---|
Fields inherited from interface org.schmant.task.confable.OverwriteConfigurable |
---|
DEFAULT_OVERWRITE_STRATEGY |
Constructor Summary | |
---|---|
ClosureTask(Object closure)
This constructor is used by TaskExecutor for
creating a closure task when adding a closure directly to the task
executor. |
Method Summary | |
---|---|
void |
copyProperties(ClosureTask spec)
Override the implementation from AbstractTask to copy the
source properties. |
protected String |
getDefaultLogHeader()
Get the default log header to log (to level INFO) before the task is run if the task user has not set a custom header. |
protected boolean |
isSourcesMandatory()
Must the sources property be set? This method returns true . |
protected boolean |
isTargetMandatory()
Is a target mandatory? This method always returns true . |
protected void |
runInternal(Report r)
Subclasses implement this. |
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.AbstractProcessTask |
---|
getOverwriteStrategy, getTarget, setOverwrite, setOverwriteStrategy, setTarget, toString |
Methods inherited from class org.schmant.task.stub.AbstractActionTask |
---|
addSource, addSources, clearSources, getRelativeToBase, getSource, getSources, isMoreThanOneSourceAllowed, setRelativeToBase, setSource, setSources |
Methods inherited from class org.schmant.task.stub.AbstractTask |
---|
cancel, createTask, getDefaultLogFooter, getDependencyForTasksScheduledByThisTask, 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.confable.SourceConfigurable |
---|
addSource, addSources, clearSources, setRelativeToBase, setSource, setSources |
Methods inherited from interface org.schmant.task.confable.SourceConfigured |
---|
getSource, getSources |
Methods inherited from interface org.schmant.task.TaskSpecification |
---|
createTask |
Methods inherited from interface org.schmant.task.confable.LoggingConfigurable |
---|
setLogFooter, setLogHeader, setReportLevel, setTraceLogging |
Constructor Detail |
---|
public ClosureTask(Object closure)
TaskExecutor
for
creating a closure task when adding a closure directly to the task
executor.
closure
- The closure to run.Method Detail |
---|
protected String getDefaultLogHeader()
AbstractTask
This is called after validating the task.
Return null
to disable logging.
getDefaultLogHeader
in class AbstractTask<ClosureTask>
protected boolean isTargetMandatory()
AbstractProcessTask
true
.
Subclasses may override this to return false
if a target is not
mandatory for them.
isTargetMandatory
in class AbstractProcessTask<ClosureTask>
true
, alwaysprotected boolean isSourcesMandatory()
AbstractActionTask
true
.
Subclasses may override this method to return false
if the
sources property is not mandatory.
isSourcesMandatory
in class AbstractActionTask<ClosureTask>
true
, always.protected Collection<String> validate(Report r)
AbstractActionTask
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.
validate
in class AbstractProcessTask<ClosureTask>
r
- A report to log warning and debug messages to. Validation errors
should not be logged, though. They are logged later.
protected void runInternal(Report r) throws Exception
AbstractTask
AbstractTask.validate(Report)
:d before
this method is called, see AbstractTask.run()
.
runInternal
in class AbstractTask<ClosureTask>
r
- The current thread's Report
.
Exception
- On errors.public void copyProperties(ClosureTask spec)
AbstractActionTask
AbstractTask
to copy the
source properties. Subclasses must override this to copy their own
properties.
copyProperties
in interface TaskSpecification<ClosureTask>
copyProperties
in class AbstractProcessTask<ClosureTask>
spec
- The specification to copy properties to.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |