protected Map < Computer , T > monitor ( ) throws InterruptedException { Map < Computer , T > data = new HashMap <> ( ) ; for ( Computer c : Jenkins . getInstance ( ) . getComputers ( ) ) { try { Thread . currentThread ( ) . setName ( "Monitoring " + c . getDisplayName ( ) + " for " + getDisplayName ( ) ) ; if ( c . getChannel ( ) == null ) data . put ( c , null ) ; else data . put ( c , monitor ( c ) ) ; } catch ( RuntimeException | IOException e ) { LOGGER . log ( Level . WARNING , "Failed to monitor " + c . getDisplayName ( ) + " for " + getDisplayName ( ) , e ) ; } catch ( InterruptedException e ) { throw ( InterruptedException ) new InterruptedException ( "Node monitoring " + c . getDisplayName ( ) + " for " + getDisplayName ( ) + " aborted." ) . initCause ( e ) ; } } return data ; }
Performs monitoring across the board .