java.lang.Cloneable
, org.apache.tools.ant.TaskContainer
public class Limit
extends org.apache.tools.ant.Task
implements org.apache.tools.ant.TaskContainer
Developed for use with Antelope, migrated to ant-contrib Oct 2003.
Modifier and Type | Class | Description |
---|---|---|
static class |
Limit.TimeUnit |
The enumeration of units:
millisecond, second, minute, hour, day, week
Todo: we use timestamps in many places, why not factor this out
|
Modifier and Type | Field | Description |
---|---|---|
protected Limit.TimeUnit |
unit |
Constructor | Description |
---|---|
Limit() |
Modifier and Type | Method | Description |
---|---|---|
void |
addTask(org.apache.tools.ant.Task task) |
Add a task to wait on.
|
void |
execute() |
Execute all nested tasks, but stopping execution of nested tasks after
maxwait or when all tasks are done, whichever is first.
|
void |
setDays(int value) |
Set a day wait value.
|
void |
setFailonerror(boolean fail) |
Determines whether the build should fail if the time limit has
expired on this task.
|
void |
setHours(int value) |
Set an hours wait value.
|
void |
setMaxwait(int wait) |
How long to wait for all nested tasks to complete, in units.
|
void |
setMaxWaitUnit(Limit.TimeUnit unit) |
Set the max wait time unit, default is minutes.
|
void |
setMilliseconds(int value) |
Set a millisecond wait value.
|
void |
setMinutes(int value) |
Set a minute wait value.
|
void |
setProperty(java.lang.String p) |
Name the property to set after a timeout.
|
void |
setSeconds(int value) |
Set a second wait value.
|
void |
setUnit(java.lang.String unit) |
Sets the unit for the max wait.
|
void |
setValue(java.lang.String v) |
The value for the property to set after a timeout, defaults to true.
|
void |
setWeeks(int value) |
Set a week wait value.
|
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
clone, getDescription, getLocation, getProject, setDescription, setLocation, setProject
bindToOwner, getOwningTarget, getRuntimeConfigurableWrapper, getTaskName, getTaskType, getWrapper, handleErrorFlush, handleErrorOutput, handleFlush, handleInput, handleOutput, init, isInvalid, log, log, log, log, maybeConfigure, perform, reconfigure, setOwningTarget, setRuntimeConfigurableWrapper, setTaskName, setTaskType
protected Limit.TimeUnit unit
public void addTask(org.apache.tools.ant.Task task) throws org.apache.tools.ant.BuildException
addTask
in interface org.apache.tools.ant.TaskContainer
task
- A task to executeorg.apache.tools.ant.BuildException
- won't happenpublic void setMaxwait(int wait)
wait
- time to wait, set to 0 to wait forever.public void setUnit(java.lang.String unit)
unit
- valid values are "millisecond", "second", "minute", "hour", "day", and "week".public void setMilliseconds(int value)
value
- the number of milliseconds to wait.public void setSeconds(int value)
value
- the number of seconds to wait.public void setMinutes(int value)
value
- the number of milliseconds to wait.public void setHours(int value)
value
- the number of hours to wait.public void setDays(int value)
value
- the number of days to wait.public void setWeeks(int value)
value
- the number of weeks to wait.public void setMaxWaitUnit(Limit.TimeUnit unit)
public void setFailonerror(boolean fail)
fail
- if true, fail the build if the time limit has been reached.public void setProperty(java.lang.String p)
p
- of property to set if the time limit has been reached.public void setValue(java.lang.String v)
v
- for the property to set if the time limit has been reached.public void execute() throws org.apache.tools.ant.BuildException
execute
in class org.apache.tools.ant.Task
org.apache.tools.ant.BuildException
- Description of the Exception