Hi, I have written an Ant task to start a servlet engine in another thread. Now, some servlet engines provide a way to shut them down (like a -stop flag) but others do not. I'd like to be able to stop the running server from another Ant task. The start server task actually opens a new thread and use the CallTarget inside this new thread to call an Ant target that will effectively start the server (using the java task usually, with the fork attribute set to true).
I tried to use the Thread.destroy() API but it is not implemented (as mentionned in the JDK javadoc) and the stop() method is deprecated. Moreover, even if I use the stop() method, as the java task was started using fork set, the running server is not stopped ... Do you have any idea on how I could stop the running task ? Is this something provided for somewhere in the Ant sources ? I have checked but could not find anything. I have seen the ExecuteWatchdog but could not decide if it would help or how ... Maybe getting the JVM magic number id and then using it to stop the JVM (I don't know if this is possible) ... Any idea would help ... Thanks. Vincent.
