final void destroyTaskJVM ( TaskControllerContext context ) { Thread taskJVMDestroyer = new Thread ( new DestroyJVMTaskRunnable ( context ) ) ; taskJVMDestroyer . start ( ) ; if ( waitForConfirmedKill ) { try { taskJVMDestroyer . join ( ) ; } catch ( InterruptedException e ) { throw new IllegalStateException ( "destroyTaskJVM: Failed to join " + taskJVMDestroyer . getName ( ) ) ; } } }
Use DestroyJVMTaskRunnable to kill task JVM asynchronously . Wait for the confirmed kill if configured so .