static boolean killProcess ( final String processName , int id ) { int pid ; try { pid = processUtils . resolveProcessId ( processName , id ) ; if ( pid > 0 ) { try { Runtime . getRuntime ( ) . exec ( processUtils . getKillCommand ( pid ) ) ; return true ; } catch ( Throwable t ) { ProcessLogger . ROOT_LOGGER . debugf ( t , "failed to kill process '%s' with pid '%s'" , processName , pid ) ; } } } catch ( Throwable t ) { ProcessLogger . ROOT_LOGGER . debugf ( t , "failed to resolve pid of process '%s'" , processName ) ; } return false ; }
Try to kill a given process .