[14982] | 1 | <html>
|
---|
| 2 |
|
---|
| 3 | <head>
|
---|
| 4 | <meta http-equiv="Content-Language" content="en-us">
|
---|
| 5 | <title>WaitFor Task</title>
|
---|
| 6 | <link rel="stylesheet" type="text/css" href="../stylesheets/antmanual.css">
|
---|
| 7 | </head>
|
---|
| 8 |
|
---|
| 9 | <body>
|
---|
| 10 |
|
---|
| 11 | <h2>Waitfor</h2>
|
---|
| 12 | <h3>Description</h3>
|
---|
| 13 | <p>Blocks execution until a set of specified conditions become true. This is intended
|
---|
| 14 | to be used with the <a href="parallel.html">parallel</a> task to
|
---|
| 15 | synchronize a set of processes.</p>
|
---|
| 16 | <p>The conditions to wait for are defined in <a href="waitfor.html#nested">nested elements</a>,
|
---|
| 17 | if multiple conditions are specified, then the task will wait until all conditions are true..</p>
|
---|
| 18 | <p></p>
|
---|
| 19 | <p>If both maxwait and maxwaitunit are not specified, the maxwait is 3 minutes (180000 milliseconds).</p>
|
---|
| 20 | <p>If the <code>timeoutproperty</code> attribute has been set, a
|
---|
| 21 | property of that name will be created if the condition didn't come
|
---|
| 22 | true within the specified time.</p>
|
---|
| 23 | <h3>Parameters</h3>
|
---|
| 24 | <table border="1" cellpadding="2" cellspacing="0">
|
---|
| 25 | <tr>
|
---|
| 26 | <td valign="top"><b>Attribute</b></td>
|
---|
| 27 | <td valign="top"><b>Description</b></td>
|
---|
| 28 | <td align="center" valign="top"><b>Required</b></td>
|
---|
| 29 | </tr>
|
---|
| 30 | <tr>
|
---|
| 31 | <td valign="top">maxwait</td>
|
---|
| 32 | <td valign="top">The maximum amount of time to wait for all the required conditions
|
---|
| 33 | to become true before failing the task. Defaults to 180000 maxwaitunits.</td>
|
---|
| 34 | <td valign="top" align="center">No</td>
|
---|
| 35 | </tr>
|
---|
| 36 | <tr>
|
---|
| 37 | <td valign="top">maxwaitunit</td>
|
---|
| 38 | <td valign="top">The unit of time that must be used to interpret the value of the
|
---|
| 39 | maxwait attribute. Defaults to millisecond.
|
---|
| 40 | Valid Values are
|
---|
| 41 | <ul>
|
---|
| 42 | <li>millisecond</li>
|
---|
| 43 | <li>second</li>
|
---|
| 44 | <li>minute</li>
|
---|
| 45 | <li>hour</li>
|
---|
| 46 | <li>day</li>
|
---|
| 47 | <li>week</li>
|
---|
| 48 | </ul>
|
---|
| 49 | </td>
|
---|
| 50 | <td valign="top" align="center">No</td>
|
---|
| 51 | </tr>
|
---|
| 52 | <tr>
|
---|
| 53 | <td valign="top">checkevery</td>
|
---|
| 54 | <td valign="top">The amount of time to wait between each test of the conditions.
|
---|
| 55 | Defaults to 500 checkeveryunits.</td>
|
---|
| 56 | <td valign="top" align="center">No</td>
|
---|
| 57 | </tr>
|
---|
| 58 | <tr>
|
---|
| 59 | <td valign="top">checkeveryunit</td>
|
---|
| 60 | <td valign="top">The unit of time that must be used to interpret the value of the
|
---|
| 61 | checkevery attribute. Defaults to millisecond.
|
---|
| 62 | Valid Values are
|
---|
| 63 | <ul>
|
---|
| 64 | <li>millisecond</li>
|
---|
| 65 | <li>second</li>
|
---|
| 66 | <li>minute</li>
|
---|
| 67 | <li>hour</li>
|
---|
| 68 | <li>day</li>
|
---|
| 69 | <li>week</li>
|
---|
| 70 | </ul>
|
---|
| 71 | </td>
|
---|
| 72 | <td valign="top" align="center">No</td>
|
---|
| 73 | </tr>
|
---|
| 74 | <tr>
|
---|
| 75 | <td valign="top">timeoutproperty</td>
|
---|
| 76 | <td valign="top">the name of the property to set if maxwait has
|
---|
| 77 | been exceeded.</td>
|
---|
| 78 | <td valign="top" align="center">No</td>
|
---|
| 79 | </tr>
|
---|
| 80 | </table>
|
---|
| 81 | <h3><a name="nested">Nested Elements</a></h3>
|
---|
| 82 |
|
---|
| 83 | <p>The available conditions that satisfy the
|
---|
| 84 | <code><waitfor></code> task are the same as those for the
|
---|
| 85 | <a href="condition.html"><code><condition></code></a> task. See
|
---|
| 86 | <a href="conditions.html">here</a> for the full list.</p>
|
---|
| 87 |
|
---|
| 88 | <h3>Examples</h3>
|
---|
| 89 | <blockquote><pre>
|
---|
| 90 | <waitfor maxwait="30" maxwaitunit="second">
|
---|
| 91 | <available file="errors.log"/>
|
---|
| 92 | </waitfor>
|
---|
| 93 | </pre></blockquote>
|
---|
| 94 | <p>waits up to 30 seconds for a file called errors.log to appear.</p>
|
---|
| 95 | <blockquote><pre>
|
---|
| 96 | <waitfor maxwait="3" maxwaitunit="minute" checkevery="500">
|
---|
| 97 | <http url="http://localhost/myapp/index.html"/>
|
---|
| 98 | </waitfor>
|
---|
| 99 | </pre></blockquote>
|
---|
| 100 | <p>waits up to 3 minutes (and checks every 500 milliseconds) for a web server on localhost
|
---|
| 101 | to serve up the specified URL.</p>
|
---|
| 102 | <blockquote><pre>
|
---|
| 103 | <waitfor maxwait="10" maxwait="second">
|
---|
| 104 | <and>
|
---|
| 105 | <socket server="dbserver" port="1521"/>
|
---|
| 106 | <http url="http://webserver/mypage.html"/>
|
---|
| 107 | </and>
|
---|
| 108 | </waitfor>
|
---|
| 109 | </pre></blockquote>
|
---|
| 110 | <p>waits up to 10 seconds for a server on the dbserver machine to begin listening
|
---|
| 111 | on port 1521 and for the http://webserver/mypage.html web page
|
---|
| 112 | to become available.</p>
|
---|
| 113 | <hr><p align="center">Copyright © 2001,2004-2005 The Apache Software Foundation. All rights
|
---|
| 114 | Reserved.</p>
|
---|
| 115 |
|
---|
| 116 | </body>
|
---|
| 117 | </html>
|
---|
| 118 |
|
---|