org.schmant.task.template.proxy
Class AbstractProxyTask<T extends AbstractProxyTask<T>>
java.lang.Object
org.schmant.support.AbstractArgumentChecker
org.schmant.task.stub.AbstractTask<T>
org.schmant.task.stub.AbstractActionTask<T>
org.schmant.task.stub.AbstractProcessTask<T>
org.schmant.task.template.proxy.AbstractProxyTask<T>
- All Implemented Interfaces:
- TaskDependency, ActionTaskConfigurable<T>, ActionTaskSpec<T>, LoggingConfigurable<T>, OverwriteConfigurable<T>, SourceConfigurable<T>, SourceConfigured, TargetConfigurable<T>, TargetConfigured, GeneratorTaskConfigurable<T>, GeneratorTaskSpec<T>, ProcessTaskConfigurable<T>, ProcessTaskSpec<T>, Task, TaskRunnable, TaskSpecification<T>
- Direct Known Subclasses:
- ErrorIgnoringTask, RedirectReportTask, TimedExecutionTask
public abstract class AbstractProxyTask<T extends AbstractProxyTask<T>>
- extends AbstractProcessTask<T>
Abstract base class for task proxy implementations.
- Since:
- 0.5
- Author:
- Karl Gustafsson
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, runInternal, setLogFooter, setLogHeader, setReportLevel, setTraceLogging |
AbstractProxyTask
public AbstractProxyTask()
getTaskFactory
protected final Object getTaskFactory()
- Returns:
- May be a
TaskFactory
or a closure.
getDefaultLogHeader
protected String getDefaultLogHeader()
- By default, logging is disabled.
- Overrides:
getDefaultLogHeader
in class AbstractTask<T extends AbstractProxyTask<T>>
- Returns:
- "Running " + toString()
isSourcesMandatory
protected boolean isSourcesMandatory()
- Description copied from class:
AbstractActionTask
- Must the sources property be set? This method returns
true
.
Subclasses may override this method to return false
if the
sources property is not mandatory.
- Overrides:
isSourcesMandatory
in class AbstractActionTask<T extends AbstractProxyTask<T>>
- Returns:
true
, always.
isTargetMandatory
protected boolean isTargetMandatory()
- Description copied from class:
AbstractProcessTask
- Is a target mandatory? This method always returns
true
.
Subclasses may override this to return false
if a target is not
mandatory for them.
- Overrides:
isTargetMandatory
in class AbstractProcessTask<T extends AbstractProxyTask<T>>
- Returns:
true
, always
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 AbstractProcessTask<T extends AbstractProxyTask<T>>
- 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.
createAndConfigureProxiedTask
protected Task createAndConfigureProxiedTask()
- Create and configure the proxied task. If the task is an action task,
it inherits the source settings from this task. If it
is a generator task, it inherits the target settings.
- Returns:
- The configured proxied task.
disableLoggingIfOwnLoggingIsDisabled
protected final void disableLoggingIfOwnLoggingIsDisabled(TaskSpecification<?> t)
copyProperties
public void copyProperties(T 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<T extends AbstractProxyTask<T>>
- Overrides:
copyProperties
in class AbstractProcessTask<T extends AbstractProxyTask<T>>
- Parameters:
spec
- The specification to copy properties to.