@ Nonnull private Computer getComputer ( ) throws AbortException { if ( computer != null ) { return computer ; } String node = null ; Jenkins j = Jenkins . getInstance ( ) ; for ( Computer c : j . getComputers ( ) ) { if ( c . getChannel ( ) == launcher . getChannel ( ) ) { node = c . getName ( ) ; break ; } } if ( node == null ) { throw new AbortException ( "Could not find computer for the job" ) ; } computer = j . getComputer ( node ) ; if ( computer == null ) { throw new AbortException ( "No such computer " + node ) ; } if ( LOGGER . isLoggable ( Level . FINE ) ) { LOGGER . log ( Level . FINE , "Computer: {0}" , computer . getName ( ) ) ; try { LOGGER . log ( Level . FINE , "Env: {0}" , computer . getEnvironment ( ) ) ; } catch ( IOException | InterruptedException e ) { // ignored } } return computer ; }
Gets the computer for the current launcher .