|
|||||||||
| 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<T>
public abstract class AbstractProcessTask<T extends ProcessTaskSpec<T>>
This class may be used as a starting point for process task implementations.
| Field Summary |
|---|
| Fields inherited from interface org.schmant.task.confable.OverwriteConfigurable |
|---|
DEFAULT_OVERWRITE_STRATEGY |
| Constructor Summary | |
|---|---|
AbstractProcessTask()
|
|
| Method Summary | |
|---|---|
void |
copyProperties(T spec)
Override the implementation from AbstractTask to copy the
source properties. |
protected OverwriteStrategy |
getOverwriteStrategy()
|
Object |
getTarget()
Get the target. |
protected boolean |
isTargetMandatory()
Is a target mandatory? This method always returns true. |
T |
setOverwrite(boolean b)
Should things be overwritten? If this is set to true, it is
equivalent to setting the overwrite strategy to
DoOverwriteAndLogWarning. |
T |
setOverwriteStrategy(OverwriteStrategy strat)
Set a strategy for how to react to existing entities in locations where the task wants to write. |
T |
setTarget(Object o)
Set the target. |
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.AbstractActionTask |
|---|
addSource, addSources, clearSources, getRelativeToBase, getSource, getSources, isMoreThanOneSourceAllowed, isSourcesMandatory, setRelativeToBase, setSource, setSources |
| Methods inherited from class org.schmant.task.stub.AbstractTask |
|---|
cancel, createTask, getDefaultLogFooter, getDefaultLogHeader, getDependencyForTasksScheduledByThisTask, getDependencyObservable, getFailureCause, getLogFooter, getLogHeader, getSatisfiedStateLock, getThis, isCancelled, isDone, isInterrupted, isRunning, isSatisfied, isSuccessful, run, runInternal, 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 AbstractProcessTask()
| Method Detail |
|---|
public final T setTarget(Object o)
TargetConfigurable
setTarget in interface TargetConfigurable<T extends ProcessTaskSpec<T>>o - The target.
thispublic final Object getTarget()
TargetConfigured
getTarget in interface TargetConfigurednull if it is not set.protected boolean isTargetMandatory()
true.
Subclasses may override this to return false if a target is not
mandatory for them.
true, alwayspublic final T setOverwrite(boolean b)
OverwriteConfigurabletrue, it is
equivalent to setting the overwrite strategy to
DoOverwriteAndLogWarning. If this is set to false, it is
equivalent to setting the overwrite strategy to
DontOverwriteAndLogWarning.
setOverwrite in interface OverwriteConfigurable<T extends ProcessTaskSpec<T>>b - Should things be overwritten?
thispublic final T setOverwriteStrategy(OverwriteStrategy strat)
OverwriteConfigurable
setOverwriteStrategy in interface OverwriteConfigurable<T extends ProcessTaskSpec<T>>strat - The overwrite strategy.
thisprotected final OverwriteStrategy getOverwriteStrategy()
protected Collection<String> validate(Report r)
AbstractActionTaskAbstractTask 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 AbstractActionTask<T extends ProcessTaskSpec<T>>r - A report to log warning and debug messages to. Validation errors
should not be logged, though. They are logged later.
public String toString()
AbstractTaskThis implementation just returns the class name.
toString in class AbstractActionTask<T extends ProcessTaskSpec<T>>public void copyProperties(T spec)
AbstractActionTaskAbstractTask to copy the
source properties. Subclasses must override this to copy their own
properties.
copyProperties in interface TaskSpecification<T extends ProcessTaskSpec<T>>copyProperties in class AbstractActionTask<T extends ProcessTaskSpec<T>>spec - The specification to copy properties to.
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||