I'm calling an executable within a
Java agent thusly:
The problem is that the main program will block on the waitFor() method. I'd like to run the Process in a separate
Thread and then run a timer on the main thread and interrupt the Process if the timer expires before the Process terminates.
Since Process neither extends Thread nor implements Runnable, I cannot attach it directly to a separate Thread. And since it is Abstract, I'm unable to instantiate a subclass that could otherwise be attached to a Thread.
Does anyone have a suggestion to help me trap for a hung Process and terminate it so that the main agent does not also hang?
Thanks for your help.