You can not select more than 25 topics Topics must start with a chinese character,a letter or number, can include dashes ('-') and can be up to 35 characters long.

waitfor.html 3.6 kB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788
  1. <html>
  2. <head>
  3. <meta http-equiv="Content-Language" content="en-us">
  4. <title>Apache Ant User Manual</title>
  5. </head>
  6. <body>
  7. <h2>Waitfor</h2>
  8. <h3>Description</h3>
  9. <p>Blocks execution until a set of specified conditions become true. This is intended
  10. to be used with the <a href="parallel.html">parallel</a> task to
  11. synchronize a set of processes.</p>
  12. <p>The conditions to wait for are defined in <a href="waitfor.html#nested">nested elements</a>,
  13. if multiple conditions are specified, then the task will wait until all conditions are true..</p>
  14. <p></p>
  15. <p>If both maxwait and maxwaitunit are not specified, the maxwait is 3 minutes (180000 milliseconds).</p>
  16. <h3>Parameters</h3>
  17. <table border="1" cellpadding="2" cellspacing="0">
  18. <tr>
  19. <td valign="top"><b>Attribute</b></td>
  20. <td valign="top"><b>Description</b></td>
  21. <td align="center" valign="top"><b>Required</b></td>
  22. </tr>
  23. <tr>
  24. <td valign="top">maxwait</td>
  25. <td valign="top">The maximum amount of time to wait for all the required conditions
  26. to become true before failing the task. Defaults to 180000 maxwaitunits.</td>
  27. <td valign="top" align="center">No</td>
  28. </tr>
  29. <tr>
  30. <td valign="top">maxwaitunit</td>
  31. <td valign="top">The unit of time that must be used to interpret the value of the
  32. maxwait attribute. Defaults to millisecond.</td>
  33. <td valign="top" align="center">No</td>
  34. </tr>
  35. <tr>
  36. <td valign="top">checkevery</td>
  37. <td valign="top">The amount of time to wait between each test of the conditions.
  38. Defaults to 500 checkeveryunits.</td>
  39. <td valign="top" align="center">No</td>
  40. </tr>
  41. <tr>
  42. <td valign="top">checkeveryunit</td>
  43. <td valign="top">The unit of time that must be used to interpret the value of the
  44. checkevery attribute. Defaults to millisecond.</td>
  45. <td valign="top" align="center">No</td>
  46. </tr>
  47. </table>
  48. <h3><a name="nested">Nested Elements</a></h3>
  49. <p>The available conditions that satisfy the
  50. <code>&lt;waitfor&gt;</code> task are the same as those for the
  51. <a href="condition.html"><code>&lt;condition&gt;</code></a> task. See
  52. <a href="conditions.html">here</a> for the full list.</p>
  53. <h3>Examples</h3>
  54. <blockquote>
  55. <p><code>&lt;waitfor maxwait=&quot;30&quot; maxwaitunit=&quot;second&quot;&gt;<br>
  56. &nbsp;&nbsp;&nbsp;&nbsp;&lt;available file="errors.log"/&gt;<br>
  57. &lt;/waitfor&gt;</code></p>
  58. </blockquote>
  59. <p>waits up to 30 seconds for a file called errors.log to appear.</p>
  60. <blockquote>
  61. <p><code>&lt;waitfor maxwait=&quot;3&quot; maxwaitunit=&quot;minute&quot; checkevery=&quot;500&quot;&gt;<br>
  62. &nbsp;&nbsp;&nbsp;&nbsp;&lt;http url=&quot;http://localhost/myapp/index.html&quot;/&gt;<br>
  63. &lt;/waitfor&gt;</code></p>
  64. </blockquote>
  65. <p>waits up to 3 minutes (and checks every 500 milliseconds) for a web server on localhost
  66. to serve up the specified URL.</p>
  67. <blockquote>
  68. <p><code>&lt;waitfor maxwait=&quot;10&quot; maxwait=&quot;second&quot;&gt;<br>
  69. &nbsp;&nbsp;&nbsp;&nbsp;&lt;and&gt;<br>
  70. &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;socket server=&quot;dbserver&quot; port=&quot;1521&quot;/&gt;<br>
  71. &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;http url=&quot;http://webserver/mypage.html&quot;/&gt;<br>
  72. &nbsp;&nbsp;&nbsp;&nbsp;&lt;/and&gt;<br>
  73. &lt;/waitfor&gt;</code></p>
  74. </blockquote>
  75. <p>waits up to 10 seconds for a server on the dbserver machine to begin listening
  76. on port 1521 and for the http://webserver/mypage.html web page
  77. to become available.</p>
  78. <hr><p align="center">Copyright &copy; 2000,2001 Apache Software Foundation. All rights
  79. Reserved.</p>
  80. </body>
  81. </html>