• Post Reply Bookmark Topic Watch Topic
  • New Topic

Trapping for a block in Process.waitFor()  RSS feed

 
Scott Appleton
Ranch Hand
Posts: 195
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Scott Appleton
Ranch Hand
Posts: 195
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I forgot to mention that the target of the exec is itself a java application. The main agent is being run in Lotus Notes. However, the current version of Notes (R5) uses the 1.1.8 compiler, and the requirements for this agent require that data be transmitted to an HTTPS server. JSSE supports SSL security, but is not compatible with the 1.1.8 compiler; therefore, I'm having to use a workaround wherein the data transmission is handled via an application compiled with the workstation's JDK 1.3, which must then be called from within the Notes Java agent via the Runtime.exec() method.
I'm not sure if that background is important in resolving the problem, but on the chance that it is...
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!