Class BlockFor
java.lang.Object
org.apache.tools.ant.ProjectComponent
org.apache.tools.ant.taskdefs.condition.ConditionBase
org.apache.tools.ant.taskdefs.WaitFor
org.apache.tools.ant.taskdefs.optional.testing.BlockFor
- All Implemented Interfaces:
Cloneable
- Since:
- Ant 1.8
-
Nested Class Summary
Nested classes/interfaces inherited from class WaitFor
WaitFor.UnitModifier and TypeClassDescriptionstatic classThe enumeration of units: millisecond, second, minute, hour, day, week -
Field Summary
Fields inherited from class WaitFor
DEFAULT_CHECK_MILLIS, DEFAULT_MAX_WAIT_MILLIS, ONE_DAY, ONE_HOUR, ONE_MILLISECOND, ONE_MINUTE, ONE_SECOND, ONE_WEEKModifier and TypeFieldDescriptionstatic final longdefault check timestatic final longdefault wait timestatic final longa day in millisecondsstatic final longan hour in millisecondsstatic final longa millisecondstatic final longa minute in millisecondsstatic final longa second in millisecondsstatic final longa week in millisecondsFields inherited from class ProjectComponent
description, location, project -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidSet the error text; all properties are expanded in the message.protected voidIf the wait fails, a BuildException is thrown.Methods inherited from class WaitFor
calculateCheckEveryMillis, calculateMaxWaitMillis, execute, processSuccess, setCheckEvery, setCheckEveryUnit, setMaxWait, setMaxWaitUnit, setTimeoutPropertyModifier and TypeMethodDescriptionlongGet the check wait time, in milliseconds.longGet the maximum wait time, in milliseconds.voidexecute()Check repeatedly for the specified conditions until they become true or the timeout expires.protected voidActions to be taken on a successful waitfor.voidsetCheckEvery(long time) Set the time between each checkvoidSet the check every time unitvoidsetMaxWait(long time) Set the maximum length of time to wait.voidsetMaxWaitUnit(WaitFor.Unit unit) Set the max wait time unitvoidName the property to set after a timeout.Methods inherited from class ConditionBase
add, addAnd, addAvailable, addChecksum, addContains, addEquals, addFilesMatch, addHttp, addIsFalse, addIsFileSelected, addIsReference, addIsSet, addIsTrue, addNot, addOr, addOs, addSocket, addUptodate, countConditions, getConditions, getTaskName, setTaskNameModifier and TypeMethodDescriptionvoidAdd an arbitrary conditionvoidAdd an <and> condition "container".voidAdd an <available> condition.voidAdd an <checksum> condition.voidaddContains(Contains test) Add a <contains> condition.voidAdd an <equals> condition.voidaddFilesMatch(FilesMatch test) Add a <filesmatch> condition.voidAdd an <http> condition.voidaddIsFalse(IsFalse test) Add a <isfalse> condition.voidAdd an <isfileselected> condition.voidAdd an <isreference> condition.voidAdd an <isset> condition.voidAdd a <istrue> condition.voidAdd an <not> condition "container".voidAdd an <or> condition "container".voidAdd an <os> condition.voidAdd a <socket> condition.voidAdd an <uptodate> condition.protected intCount the conditions.protected final Enumeration<Condition> Iterate through all conditions.Returns the name to use in logging messages.voidsetTaskName(String name) Sets the name to use in logging messages.Methods inherited from class ProjectComponent
clone, getDescription, getLocation, getProject, log, log, setDescription, setLocation, setProjectModifier and TypeMethodDescriptionclone()Returns the description of the current action.Returns the file/location where this task was defined.Returns the project to which this component belongs.voidLogs a message with the default (INFO) priority.voidLogs a message with the given priority.voidsetDescription(String desc) Sets a description of the current action.voidsetLocation(Location location) Sets the file/location where this task was defined.voidsetProject(Project project) Sets the project object of this component.
-
Constructor Details
-
BlockFor
public BlockFor()Constructor that takes the name of the task in the task name. -
BlockFor
Constructor that takes the name of the task in the task name.- Parameters:
taskName- the name of the task.
-
-
Method Details
-
processTimeout
If the wait fails, a BuildException is thrown. All the superclasses actions are called first.- Overrides:
processTimeoutin classWaitFor- Throws:
BuildTimeoutException- on timeout, using the text intext
-
addText
Set the error text; all properties are expanded in the message.- Parameters:
message- the text to use in a failure message
-