|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface TaskFactory<T extends TaskFactory<T,U>,U extends TaskSpecification<U>>
All Task
:s are created by a task factory. The task factory can be
reused to create several Task
objects.
The task factory creates a Task
by configuring a
TaskSpecification
, and using that to create the Task
when
the build script calls create()
. If setter methods on the task
factory are called after creating a task, it makes a copy of the
TaskSpecification
and configures that object instead.
The task factory is TaskRunnable
in itself. Running a task factory is a
shortcut for calling create().run()
on it.
A task factory is required to have a no-argument constructor. All configuration should be done through setter methods.
Task factories are not designed to be thread safe. They are used in the
thread running the script. TaskExecutor
:s use Task
:s. If the task factory is used in a setting where it may be used
concurrently by several threads, such as from another task, it must be locked
for exclusive access using its intrinsic lock (synchronized).
Method Summary | |
---|---|
T |
copy()
Create a copy of this task factory. |
Task |
create()
Create a task. |
Task |
getLastCreated()
Get the last created task. |
U |
getSpecification()
Get the specification that this task factory object is currently working on. |
Methods inherited from interface org.schmant.task.confable.LoggingConfigurable |
---|
setLogFooter, setLogHeader, setReportLevel, setTraceLogging |
Methods inherited from interface org.schmant.task.TaskRunnable |
---|
run |
Method Detail |
---|
Task create()
Task getLastCreated()
T copy()
TaskSpecification
object having the same configuration as this
task factory's specification object.
U getSpecification()
Task factory implementations use this method to get the specification that they are currently configuring. This method takes care of creating new specification objects as needed.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |