[Image]
             - The External Ant Tool for Remote Method Invocation

 
 

 
 
 
[Image]
 
[Image]
 
[Image]


 
 
 

FAQ

Wednesday, November 13, 2002

This FAQ will be updated periodically based on questions received.  Please email or post any additional questions you may have.

Why use EATRMI tasks when you can accomplish the equivalent with core Ant tasks?

  • It's true you can start a process in Ant, do a few other tasks, and then bring everything together to continue on.  This is accomplished through the use of Ant's parallel task and associated elements.  Here is a quoted example from the Ant manual:
<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.

The above example illustrates the power and complexity of spawning and managing processes in an Ant script.  EATRMI tasks simplify this process, for example:

<rmid startuptime="30000">
<junit ...>

No more messing around with parallel and sequential, hoping the processes will be destroyed if the VM exits or the build ends (unless configured otherwise, spawned processes are destroyed on build end or VM exit).  Now you can spawn your process in one target, test in another, and finally query the results of the process in another target.

What processes can be spawned with BackgroundExecTask?

  • Currently, you should only spawn processes that do not require the direct handling of their input, output, or error streams. Because processes spawned by BackgroundExecTask have the potential to live after VM exit, their streams should be handled externally.  Future versions may incorporate handling of the io streams while the VM is alive.

Can a process spawned in one project be referenced in another?

  • Yes, this is accomplished through the use of the Ant task or AntCall task.  The easiest way to do this is by setting the inheritRefs attribute to true.  Optionally, you can also use the nested reference element to specify specific processes to be shared.  Please read the Ant manual for further detail.

Why doesn't BackgroundExecTask extend or use ExecTask from Ant?

  • While BackgroundExecTask and ExecTask both spawn processes, they need to treat their processes differently. Contrary to ExecTask, BackgroundExecTask actually does not manage the process it spawns. This responsibility is left to the ProcessManager and ProcessTask.

Why doesn't BackgroundExecTask offer a failOnError option?

  • The failOnError option is available through the ProcessTask. A failOnError option implemented through BackgroundExecTask would ultimately result in a BuildException being thrown asynchronously. This behavior could leave the build in an undetermined state.

Why did you use the Apache license?

  • Because this project is an extension to Jakarta's build tool, Ant.

 



Printer Friendly Version