Package ise.antelope.tasks
Class Repeat
- java.lang.Object
-
- org.apache.tools.ant.ProjectComponent
-
- org.apache.tools.ant.Task
-
- ise.antelope.tasks.Repeat
-
- All Implemented Interfaces:
java.lang.Cloneable,org.apache.tools.ant.TaskContainer
public class Repeat extends org.apache.tools.ant.Task implements org.apache.tools.ant.TaskContainerRepeatedly executes a set of tasks. Borrowed most of the code from the Limit task.- Since:
- Ant 1.5
- Version:
- $Revision: 150 $
-
-
Field Summary
Fields Modifier and Type Field Description protected ise.antelope.tasks.typedefs.TimeUnitunit
-
Constructor Summary
Constructors Constructor Description Repeat()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddTask(org.apache.tools.ant.Task task)Add a task to repeat.voidaddUntil(BooleanConditionTask c)"until" is the same as a "bool" as used in assert and if.voidexecute()Execute all nested tasks, repeating.voidsetCount(int count)Sets the number of times to repeat, default is 1.voidsetDays(int value)Set a number of days between repeats.voidsetFailonerror(boolean fail)Determines whether the build should fail if the time limit has expired on this task.voidsetHours(int value)Set a number of hours between repeats.voidsetInterval(int wait)How long to wait between repeating the nested tasks, default is 10 sec.voidsetMilliseconds(int value)Set a number of milliseconds between repeats.voidsetMinutes(int value)Set a number of minutes between repeats.voidsetProperty(java.lang.String p)Name the property to set after all repeats are complete.voidsetRepeatunit(ise.antelope.tasks.typedefs.TimeUnit unit)Set the max wait time unit, default is minutes.voidsetSeconds(int value)Set a number of seconds between repeats.voidsetUnit(java.lang.String unit)Sets the unit for the time between repeats.voidsetValue(java.lang.String v)The value for the property to set after all repeats are complete, defaults to true.voidsetWeeks(int value)Set a number of weeks between repeats.-
Methods inherited from class org.apache.tools.ant.Task
bindToOwner, getOwningTarget, getRuntimeConfigurableWrapper, getTaskName, getTaskType, getWrapper, handleErrorFlush, handleErrorOutput, handleFlush, handleInput, handleOutput, init, isInvalid, log, log, log, log, maybeConfigure, perform, reconfigure, setOwningTarget, setRuntimeConfigurableWrapper, setTaskName, setTaskType
-
-
-
-
Method Detail
-
addTask
public void addTask(org.apache.tools.ant.Task task) throws org.apache.tools.ant.BuildExceptionAdd a task to repeat.- Specified by:
addTaskin interfaceorg.apache.tools.ant.TaskContainer- Parameters:
task- A task to execute- Throws:
org.apache.tools.ant.BuildException- won't happen
-
addUntil
public void addUntil(BooleanConditionTask c) throws org.apache.tools.ant.BuildException
"until" is the same as a "bool" as used in assert and if. If used, this task will repeat until either this condition is met or the maximum number of repetitions has been met, whichever is first.- Parameters:
c- The feature to be added to the Until attribute- Throws:
org.apache.tools.ant.BuildException- Description of Exception
-
setInterval
public void setInterval(int wait)
How long to wait between repeating the nested tasks, default is 10 sec.- Parameters:
wait- time between repeats
-
setUnit
public void setUnit(java.lang.String unit)
Sets the unit for the time between repeats. Default is seconds.- Parameters:
unit- valid values are "millisecond", "second", "minute", "hour", "day", and "week".
-
setMilliseconds
public void setMilliseconds(int value)
Set a number of milliseconds between repeats.- Parameters:
value- the number of milliseconds between repeats.
-
setSeconds
public void setSeconds(int value)
Set a number of seconds between repeats.- Parameters:
value- the number of seconds to wait.
-
setMinutes
public void setMinutes(int value)
Set a number of minutes between repeats.- Parameters:
value- the number of milliseconds to wait.
-
setHours
public void setHours(int value)
Set a number of hours between repeats.- Parameters:
value- the number of hours to wait.
-
setDays
public void setDays(int value)
Set a number of days between repeats.- Parameters:
value- the number of days to wait.
-
setWeeks
public void setWeeks(int value)
Set a number of weeks between repeats.- Parameters:
value- the number of weeks to wait.
-
setRepeatunit
public void setRepeatunit(ise.antelope.tasks.typedefs.TimeUnit unit)
Set the max wait time unit, default is minutes.- Parameters:
unit- The new repeatUnit value
-
setFailonerror
public void setFailonerror(boolean fail)
Determines whether the build should fail if the time limit has expired on this task. Default is no.- Parameters:
fail- if true, fail the build if the time limit has been reached.
-
setProperty
public void setProperty(java.lang.String p)
Name the property to set after all repeats are complete.- Parameters:
p- name of property
-
setValue
public void setValue(java.lang.String v)
The value for the property to set after all repeats are complete, defaults to true.- Parameters:
v- value for the property
-
setCount
public void setCount(int count)
Sets the number of times to repeat, default is 1. Use -1 to repeat forever.- Parameters:
count- The new repeatCount value
-
execute
public void execute() throws org.apache.tools.ant.BuildExceptionExecute all nested tasks, repeating.- Overrides:
executein classorg.apache.tools.ant.Task- Throws:
org.apache.tools.ant.BuildException- Description of the Exception
-
-