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 4.3 KiB

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