2006-09-11 04:19:00 +00:00
|
|
|
<!--
|
|
|
|
Licensed to the Apache Software Foundation (ASF) under one or more
|
|
|
|
contributor license agreements. See the NOTICE file distributed with
|
|
|
|
this work for additional information regarding copyright ownership.
|
|
|
|
The ASF licenses this file to You under the Apache License, Version 2.0
|
|
|
|
(the "License"); you may not use this file except in compliance with
|
|
|
|
the License. You may obtain a copy of the License at
|
|
|
|
|
|
|
|
http://www.apache.org/licenses/LICENSE-2.0
|
|
|
|
|
|
|
|
Unless required by applicable law or agreed to in writing, software
|
|
|
|
distributed under the License is distributed on an "AS IS" BASIS,
|
|
|
|
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
|
|
See the License for the specific language governing permissions and
|
|
|
|
limitations under the License.
|
|
|
|
-->
|
2001-11-30 12:05:27 +00:00
|
|
|
<html>
|
|
|
|
|
|
|
|
<head>
|
|
|
|
<meta http-equiv="Content-Language" content="en-us">
|
2005-04-29 18:58:16 +00:00
|
|
|
<link rel="stylesheet" type="text/css" href="../stylesheets/style.css">
|
2002-02-03 22:00:42 +00:00
|
|
|
<title>WaitFor Task</title>
|
2001-11-30 12:05:27 +00:00
|
|
|
</head>
|
|
|
|
|
|
|
|
<body>
|
|
|
|
|
|
|
|
<h2>Waitfor</h2>
|
|
|
|
<h3>Description</h3>
|
2018-02-28 07:58:59 +01:00
|
|
|
<p>Blocks execution until a set of specified conditions become true. This is intended to be used
|
|
|
|
with the <a href="parallel.html">parallel</a> task to synchronize a set of processes.</p>
|
|
|
|
<p>The conditions to wait for are defined in <a href="waitfor.html#nested">nested elements</a>, if
|
|
|
|
multiple conditions are specified, then the task will wait until all conditions are true.</p>
|
|
|
|
<p>If both <var>maxwait</var> and <var>maxwaitunit</var> are not specified,
|
|
|
|
default <var>maxwait</var> is 3 minutes (180000 milliseconds).</p>
|
|
|
|
<p>If the <var>timeoutproperty</var> attribute has been set, a property of that name will be created
|
|
|
|
if the condition didn't come true within the specified time.</p>
|
2001-11-30 12:05:27 +00:00
|
|
|
<h3>Parameters</h3>
|
2018-02-28 07:58:59 +01:00
|
|
|
<table class="attr">
|
2001-12-05 20:22:19 +00:00
|
|
|
<tr>
|
2018-02-28 07:58:59 +01:00
|
|
|
<th>Attribute</th>
|
|
|
|
<th>Description</th>
|
|
|
|
<th>Required</th>
|
2001-11-30 12:05:27 +00:00
|
|
|
</tr>
|
2001-12-05 20:22:19 +00:00
|
|
|
<tr>
|
2018-02-28 07:58:59 +01:00
|
|
|
<td>maxwait</td>
|
|
|
|
<td>The maximum amount of time to wait for all the required conditions to become true before
|
|
|
|
failing the task.</td>
|
|
|
|
<td>No; defaults to 180000 <var>maxwaitunit</var>s</td>
|
2001-11-30 12:05:27 +00:00
|
|
|
</tr>
|
2001-12-05 20:22:19 +00:00
|
|
|
<tr>
|
2018-02-28 07:58:59 +01:00
|
|
|
<td>maxwaitunit</td>
|
|
|
|
<td>The unit of time that must be used to interpret the value of the <var>maxwait</var>
|
|
|
|
attribute. Valid values are
|
|
|
|
<ul>
|
|
|
|
<li><q>millisecond</q></li>
|
|
|
|
<li><q>second</q></li>
|
|
|
|
<li><q>minute</q></li>
|
|
|
|
<li><q>hour</q></li>
|
|
|
|
<li><q>day</q></li>
|
|
|
|
<li><q>week</q></li>
|
|
|
|
</ul>
|
|
|
|
</td>
|
|
|
|
<td>No; defaults to <q>millisecond</q></td>
|
2001-12-05 20:22:19 +00:00
|
|
|
</tr>
|
|
|
|
<tr>
|
2018-02-28 07:58:59 +01:00
|
|
|
<td>checkevery</td>
|
|
|
|
<td>The amount of time to wait between each test of the conditions.</td>
|
|
|
|
<td>No; defaults to 500 <var>checkeveryunit</var>s</td>
|
2001-12-05 20:22:19 +00:00
|
|
|
</tr>
|
|
|
|
<tr>
|
2018-02-28 07:58:59 +01:00
|
|
|
<td>checkeveryunit</td>
|
|
|
|
<td>The unit of time that must be used to interpret the value of the <var>checkevery</var>
|
|
|
|
attribute. Valid values are
|
|
|
|
<ul>
|
|
|
|
<li><q>millisecond</q></li>
|
|
|
|
<li><q>second</q></li>
|
|
|
|
<li><q>minute</q></li>
|
|
|
|
<li><q>hour</q></li>
|
|
|
|
<li><q>day</q></li>
|
|
|
|
<li><q>week</q></li>
|
|
|
|
</ul>
|
2001-12-05 20:30:49 +00:00
|
|
|
</td>
|
2018-02-28 07:58:59 +01:00
|
|
|
<td>No; defaults to <q>millisecond</q></td>
|
2001-11-30 12:05:27 +00:00
|
|
|
</tr>
|
2001-12-12 09:03:31 +00:00
|
|
|
<tr>
|
2018-02-28 07:58:59 +01:00
|
|
|
<td>timeoutproperty</td>
|
|
|
|
<td>the name of the property to set if <var>maxwait</var> has been exceeded.</td>
|
|
|
|
<td>No</td>
|
2001-12-12 09:03:31 +00:00
|
|
|
</tr>
|
2001-11-30 12:05:27 +00:00
|
|
|
</table>
|
|
|
|
|
2018-01-22 23:52:21 +01:00
|
|
|
<h3 id="nested">Nested Elements</h3>
|
2018-02-28 07:58:59 +01:00
|
|
|
<p>The available conditions that satisfy the <code><waitfor></code> task are the same as those
|
|
|
|
for the <a href="condition.html"><code><condition></code></a>
|
|
|
|
task. See <a href="conditions.html">here</a> for the full list.</p>
|
2001-11-30 12:05:27 +00:00
|
|
|
|
|
|
|
<h3>Examples</h3>
|
2018-02-09 06:54:03 +01:00
|
|
|
<pre>
|
2005-03-10 13:01:55 +00:00
|
|
|
<waitfor maxwait="30" maxwaitunit="second">
|
2018-02-28 07:58:59 +01:00
|
|
|
<available file="errors.log"/>
|
|
|
|
</waitfor></pre>
|
|
|
|
<p>waits up to 30 seconds for a file called <samp>errors.log</samp> to appear.</p>
|
2018-02-09 06:54:03 +01:00
|
|
|
<pre>
|
2005-03-10 13:01:55 +00:00
|
|
|
<waitfor maxwait="3" maxwaitunit="minute" checkevery="500">
|
2018-02-28 07:58:59 +01:00
|
|
|
<http url="http://localhost/myapp/index.html"/>
|
|
|
|
</waitfor></pre>
|
|
|
|
<p>waits up to 3 minutes (and checks every 500 milliseconds) for a web server
|
|
|
|
on <samp>localhost</samp> to serve up the specified URL.</p>
|
2018-02-09 06:54:03 +01:00
|
|
|
<pre>
|
2005-10-10 15:54:31 +00:00
|
|
|
<waitfor maxwait="10" maxwaitunit="second">
|
2018-02-28 07:58:59 +01:00
|
|
|
<and>
|
|
|
|
<socket server="dbserver" port="1521"/>
|
|
|
|
<http url="http://webserver/mypage.html"/>
|
|
|
|
</and>
|
|
|
|
</waitfor></pre>
|
|
|
|
<p>waits up to 10 seconds for a server on the <samp>dbserver</samp> machine to begin listening on
|
|
|
|
port 1521 and for the <samp>http://webserver/mypage.html</samp> web page to become available.</p>
|
2006-09-11 20:22:51 +00:00
|
|
|
|
2001-11-30 12:05:27 +00:00
|
|
|
</body>
|
|
|
|
</html>
|