1 | <!--
|
---|
2 | Licensed to the Apache Software Foundation (ASF) under one or more
|
---|
3 | contributor license agreements. See the NOTICE file distributed with
|
---|
4 | this work for additional information regarding copyright ownership.
|
---|
5 | The ASF licenses this file to You under the Apache License, Version 2.0
|
---|
6 | (the "License"); you may not use this file except in compliance with
|
---|
7 | the License. You may obtain a copy of the License at
|
---|
8 |
|
---|
9 | http://www.apache.org/licenses/LICENSE-2.0
|
---|
10 |
|
---|
11 | Unless required by applicable law or agreed to in writing, software
|
---|
12 | distributed under the License is distributed on an "AS IS" BASIS,
|
---|
13 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
---|
14 | See the License for the specific language governing permissions and
|
---|
15 | limitations under the License.
|
---|
16 | -->
|
---|
17 | <html>
|
---|
18 |
|
---|
19 | <head>
|
---|
20 | <meta http-equiv="Content-Language" content="en-us">
|
---|
21 | <link rel="stylesheet" type="text/css" href="../stylesheets/style.css">
|
---|
22 | <title>WaitFor Task</title>
|
---|
23 | </head>
|
---|
24 |
|
---|
25 | <body>
|
---|
26 |
|
---|
27 | <h2>Waitfor</h2>
|
---|
28 | <h3>Description</h3>
|
---|
29 | <p>Blocks execution until a set of specified conditions become true. This is intended
|
---|
30 | to be used with the <a href="parallel.html">parallel</a> task to
|
---|
31 | synchronize a set of processes.</p>
|
---|
32 | <p>The conditions to wait for are defined in <a href="waitfor.html#nested">nested elements</a>,
|
---|
33 | if multiple conditions are specified, then the task will wait until all conditions are true..</p>
|
---|
34 | <p></p>
|
---|
35 | <p>If both maxwait and maxwaitunit are not specified, the maxwait is 3 minutes (180000 milliseconds).</p>
|
---|
36 | <p>If the <code>timeoutproperty</code> attribute has been set, a
|
---|
37 | property of that name will be created if the condition didn't come
|
---|
38 | true within the specified time.</p>
|
---|
39 | <h3>Parameters</h3>
|
---|
40 | <table border="1" cellpadding="2" cellspacing="0">
|
---|
41 | <tr>
|
---|
42 | <td valign="top"><b>Attribute</b></td>
|
---|
43 | <td valign="top"><b>Description</b></td>
|
---|
44 | <td align="center" valign="top"><b>Required</b></td>
|
---|
45 | </tr>
|
---|
46 | <tr>
|
---|
47 | <td valign="top">maxwait</td>
|
---|
48 | <td valign="top">The maximum amount of time to wait for all the required conditions
|
---|
49 | to become true before failing the task. Defaults to 180000 maxwaitunits.</td>
|
---|
50 | <td valign="top" align="center">No</td>
|
---|
51 | </tr>
|
---|
52 | <tr>
|
---|
53 | <td valign="top">maxwaitunit</td>
|
---|
54 | <td valign="top">The unit of time that must be used to interpret the value of the
|
---|
55 | maxwait attribute. Defaults to millisecond.
|
---|
56 | Valid Values are
|
---|
57 | <ul>
|
---|
58 | <li>millisecond</li>
|
---|
59 | <li>second</li>
|
---|
60 | <li>minute</li>
|
---|
61 | <li>hour</li>
|
---|
62 | <li>day</li>
|
---|
63 | <li>week</li>
|
---|
64 | </ul>
|
---|
65 | </td>
|
---|
66 | <td valign="top" align="center">No</td>
|
---|
67 | </tr>
|
---|
68 | <tr>
|
---|
69 | <td valign="top">checkevery</td>
|
---|
70 | <td valign="top">The amount of time to wait between each test of the conditions.
|
---|
71 | Defaults to 500 checkeveryunits.</td>
|
---|
72 | <td valign="top" align="center">No</td>
|
---|
73 | </tr>
|
---|
74 | <tr>
|
---|
75 | <td valign="top">checkeveryunit</td>
|
---|
76 | <td valign="top">The unit of time that must be used to interpret the value of the
|
---|
77 | checkevery attribute. Defaults to millisecond.
|
---|
78 | Valid Values are
|
---|
79 | <ul>
|
---|
80 | <li>millisecond</li>
|
---|
81 | <li>second</li>
|
---|
82 | <li>minute</li>
|
---|
83 | <li>hour</li>
|
---|
84 | <li>day</li>
|
---|
85 | <li>week</li>
|
---|
86 | </ul>
|
---|
87 | </td>
|
---|
88 | <td valign="top" align="center">No</td>
|
---|
89 | </tr>
|
---|
90 | <tr>
|
---|
91 | <td valign="top">timeoutproperty</td>
|
---|
92 | <td valign="top">the name of the property to set if maxwait has
|
---|
93 | been exceeded.</td>
|
---|
94 | <td valign="top" align="center">No</td>
|
---|
95 | </tr>
|
---|
96 | </table>
|
---|
97 | <h3><a name="nested">Nested Elements</a></h3>
|
---|
98 |
|
---|
99 | <p>The available conditions that satisfy the
|
---|
100 | <code><waitfor></code> task are the same as those for the
|
---|
101 | <a href="condition.html"><code><condition></code></a> task. See
|
---|
102 | <a href="conditions.html">here</a> for the full list.</p>
|
---|
103 |
|
---|
104 | <h3>Examples</h3>
|
---|
105 | <blockquote><pre>
|
---|
106 | <waitfor maxwait="30" maxwaitunit="second">
|
---|
107 | <available file="errors.log"/>
|
---|
108 | </waitfor>
|
---|
109 | </pre></blockquote>
|
---|
110 | <p>waits up to 30 seconds for a file called errors.log to appear.</p>
|
---|
111 | <blockquote><pre>
|
---|
112 | <waitfor maxwait="3" maxwaitunit="minute" checkevery="500">
|
---|
113 | <http url="http://localhost/myapp/index.html"/>
|
---|
114 | </waitfor>
|
---|
115 | </pre></blockquote>
|
---|
116 | <p>waits up to 3 minutes (and checks every 500 milliseconds) for a web server on localhost
|
---|
117 | to serve up the specified URL.</p>
|
---|
118 | <blockquote><pre>
|
---|
119 | <waitfor maxwait="10" maxwaitunit="second">
|
---|
120 | <and>
|
---|
121 | <socket server="dbserver" port="1521"/>
|
---|
122 | <http url="http://webserver/mypage.html"/>
|
---|
123 | </and>
|
---|
124 | </waitfor>
|
---|
125 | </pre></blockquote>
|
---|
126 | <p>waits up to 10 seconds for a server on the dbserver machine to begin listening
|
---|
127 | on port 1521 and for the http://webserver/mypage.html web page
|
---|
128 | to become available.</p>
|
---|
129 |
|
---|
130 |
|
---|
131 | </body>
|
---|
132 | </html>
|
---|
133 |
|
---|