java.lang.Process big problem...Too limited

I am facing a problem because of java.lang.Process limited finctionality...

as Thread.isAlive() tells us that whether a thread is alive or not ,there is no method that tells whether a process is alive or not....

There is a method calledwaitFor(),it returns if the process is terminated bu blocks if the process has not terminated.....

So i need something that can tell me that the process is alive or dead......Please tell me if anyone can......

[470 byte] By [Nistelrooya] at [2007-10-3 3:33:21]
# 1

From the JavaDocs http://java.sun.com/j2se/1.5.0/docs/api/index.html

Under the Process class, read about the exitValue() method. You might want to try that (and catch the possible exception), though using something which throws an exception for a 'happy path' (process has not yet terminated) smells a bit. It does seem like there should be a 'check termination status' method.

warnerjaa at 2007-7-14 21:27:42 > top of Java-index,Java Essentials,Java Programming...
# 2
exitValue() will do what you want indeed.Might be of interest: http://www.javaworld.com/javaworld/jw-12-2000/jw-1229-traps.html
Lokoa at 2007-7-14 21:27:42 > top of Java-index,Java Essentials,Java Programming...