public static boolean stopProcess ( final AbstractProcessorThread proc ) { proc . info ( "************************************************************" ) ; proc . info ( " * Stopping " + proc . getName ( ) ) ; proc . info ( "************************************************************" ) ; proc . setRunning ( false ) ; proc . interrupt ( ) ; boolean ok = true ; try { proc . join ( 20 * 1000 ) ; } catch ( final InterruptedException ignored ) { } catch ( final Throwable t ) { proc . error ( "Error waiting for processor termination" ) ; proc . error ( t ) ; ok = false ; } proc . info ( "************************************************************" ) ; proc . info ( " * " + proc . getName ( ) + " terminated" ) ; proc . info ( "************************************************************" ) ; return ok ; }
Shut down a running process .