The Artima Developer Community
Sponsored Link

Legacy Java Answers Forum
December 2000

Advertisement

Advertisement

This page contains an archived post to the Java Answers Forum made prior to February 25, 2002. If you wish to participate in discussions, please visit the new Artima Forums.

Message:

determining Process death

Posted by ted lin on December 18, 2000 at 2:35 PM

I am launching separate java classes in their own processes. I need to be able to determine if the spawned process dies or gets killed by external forces (eg. task manager in Windows). I think I can poll the Process.exitValue() and if it doesn't throw an exception, it's still running. However, this is a bit awkward. Am I better off creating a "heartbeat" daemon thread in the classes that are spawned? In this case, I still don't have a handle to the new Runtime so I can't check isAlive() (or can I?). So, it could output a magic string every second or so, which I could read from Process.getInputStream. Does this make any sense? Should I put down the crack pipe? Thanks for your help.l



Replies:

Sponsored Links



Google
  Web Artima.com   
Copyright © 1996-2009 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use - Advertise with Us