@ CheckForNull public static Executor of ( Executable executable ) { Jenkins jenkins = Jenkins . getInstanceOrNull ( ) ; // TODO confirm safe to assume non-null and use getInstance() if ( jenkins == null ) { return null ; } for ( Computer computer : jenkins . getComputers ( ) ) { for ( Executor executor : computer . getAllExecutors ( ) ) { if ( executor . getCurrentExecutable ( ) == executable ) { return executor ; } } } return null ; }
Finds the executor currently running a given process .