|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.tools.ant.ProjectComponent
org.apache.tools.ant.taskdefs.condition.ConditionBase
org.apache.tools.ant.taskdefs.WaitFor
public class WaitFor
Wait for an external event to occur.
Wait for an external process to start or to complete some
task. This is useful with the parallel
task to
synchronize the execution of tests with server startup.
The following attributes can be specified on a waitfor task:
processSuccess
and processTimeout
Nested Class Summary | |
---|---|
static class |
WaitFor.Unit
The enumeration of units: millisecond, second, minute, hour, day, week |
Field Summary | |
---|---|
static long |
DEFAULT_CHECK_MILLIS
default check time |
static long |
DEFAULT_MAX_WAIT_MILLIS
default wait time |
static long |
ONE_DAY
a day in milliseconds |
static long |
ONE_HOUR
an hour in milliseconds |
static long |
ONE_MILLISECOND
a millisecond |
static long |
ONE_MINUTE
a minute in milliseconds |
static long |
ONE_SECOND
a second in milliseconds |
static long |
ONE_WEEK
a week in milliseconds |
Fields inherited from class org.apache.tools.ant.ProjectComponent |
---|
description, location, project |
Constructor Summary | |
---|---|
WaitFor()
Constructor, names this task "waitfor". |
|
WaitFor(java.lang.String taskName)
Constructor that takes the name of the task in the task name. |
Method Summary | |
---|---|
long |
calculateCheckEveryMillis()
Get the check wait time, in milliseconds. |
long |
calculateMaxWaitMillis()
Get the maxiumum wait time, in milliseconds. |
void |
execute()
Check repeatedly for the specified conditions until they become true or the timeout expires. |
protected void |
processSuccess()
Actions to be taken on a successful waitfor. |
protected void |
processTimeout()
Actions to be taken on an unsuccessful wait. |
void |
setCheckEvery(long time)
Set the time between each check |
void |
setCheckEveryUnit(WaitFor.Unit unit)
Set the check every time unit |
void |
setMaxWait(long time)
Set the maximum length of time to wait. |
void |
setMaxWaitUnit(WaitFor.Unit unit)
Set the max wait time unit |
void |
setTimeoutProperty(java.lang.String p)
Name the property to set after a timeout. |
Methods inherited from class org.apache.tools.ant.taskdefs.condition.ConditionBase |
---|
add, addAnd, addAvailable, addChecksum, addContains, addEquals, addFilesMatch, addHttp, addIsFalse, addIsFileSelected, addIsReference, addIsSet, addIsTrue, addNot, addOr, addOs, addSocket, addUptodate, countConditions, getConditions, getTaskName, setTaskName |
Methods inherited from class org.apache.tools.ant.ProjectComponent |
---|
clone, getDescription, getLocation, getProject, log, log, setDescription, setLocation, setProject |
Methods inherited from class java.lang.Object |
---|
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final long ONE_MILLISECOND
public static final long ONE_SECOND
public static final long ONE_MINUTE
public static final long ONE_HOUR
public static final long ONE_DAY
public static final long ONE_WEEK
public static final long DEFAULT_MAX_WAIT_MILLIS
public static final long DEFAULT_CHECK_MILLIS
Constructor Detail |
---|
public WaitFor()
public WaitFor(java.lang.String taskName)
taskName
- the name of the task.Method Detail |
---|
public void setMaxWait(long time)
time
- a long
valuepublic void setMaxWaitUnit(WaitFor.Unit unit)
unit
- an enumerated Unit
valuepublic void setCheckEvery(long time)
time
- a long
valuepublic void setCheckEveryUnit(WaitFor.Unit unit)
unit
- an enumerated Unit
valuepublic void setTimeoutProperty(java.lang.String p)
p
- the property namepublic void execute() throws BuildException
BuildException
- on errorpublic long calculateCheckEveryMillis()
public long calculateMaxWaitMillis()
protected void processSuccess()
protected void processTimeout()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |