next up previous contents index
Next: Patch Up: Parallel Previous: Description   Contents   Index

Examples

<parallel>
  <wlrun ... >
  <sequential>
    <sleep seconds="30"/>
    <junit ... >
    <wlstop/>
  </sequential>
</parallel>
This example represents a typical pattern for testing a server application. In one thread the server is started (the wlrun task). The other thread consists of a three tasks which are performed in sequence. The sleep task is used to give the server time to come up. Another task which is capable of validating that the server is available could be used in place of the sleep task. The test harness is then run. Once the tests are complete, the server is stopped (using wlstop in this example), allowing both threads to complete. The parallel task will also complete at this time and the build will then continue.
<parallel>
  <javac ...> <!-- compiler servlet code -->
  <wljspc ...> <!-- precompile JSPs -->
</parallel>
This example shows two independent tasks being run to achieve better resource utilization during the build. In this instance, some servlets are being compiled in one thead and a set of JSPs is being precompiled in another. As noted above, you need to be careful that the two tasks are independent, both in terms of their dependencies and in terms of their potential interactions in Ant's external environment.


next up previous contents index
Next: Patch Up: Parallel Previous: Description   Contents   Index
Andrew Marlow 2003-07-08