Uploaded image for project: 'Commons Exec'
  1. Commons Exec
  2. EXEC-42

Tutorial should include example for asynchronous handling

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 1.0, 1.0.1
    • 1.1
    • None

    Description

      I had some difficulties figuring out, how to asynchronously start a process. You should include an example for this on the tutorial page. Especially interesting is the following:

      • How to start it (explain ExecuteResultHandler and that the callbacks are called from another thread, so these should be implemented thread-safe)
      • How to know if it is still running (not possible via watchdog, but has to be implemented for oneself using the ExecuteResultHandler, again watch out for thread safety)
      • How to force to terminate a process (using the watchdog)
      • Add a hint about StreamHandler and that you should always use a PumpStreamHandler (otherwise this could lead to deadlocks, see http://www.javaworld.com/javaworld/jw-12-2000/jw-1229-traps.html?).
      • Add an explanation of exit values, since an exit value which is not in the list of the DefaultExecutor, leads automatically to an exception, which is not clear from the javadocs.

      Attachments

        Activity

          People

            sgoeschl Siegfried Goeschl
            kwin Konrad Windszus
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: