/** * Obtains the list of killers. */ /*package*/ final List<ProcessKiller> getKillers() throws InterruptedException { if (killers==null) try { VirtualChannel channelToMaster = SlaveComputer.getChannelToMaster(); if (channelToMaster!=null) { killers = channelToMaster.call(new ListAll()); } else { // used in an environment that doesn't support talk-back to the master. // let's do with what we have. killers = Collections.emptyList(); } } catch (IOException | Error e) { LOGGER.log(Level.WARNING, "Failed to obtain killers", e); killers = Collections.emptyList(); } return killers; } private static class ListAll extends SlaveToMasterCallable<List<ProcessKiller>, IOException> {
/** * @return The first non-null {@link VetoCause} provided by a process killing veto extension for this OSProcess. * null if no one objects killing the process. */ protected @CheckForNull VetoCause getVeto() { String causeMessage = null; // Quick check, does anything exist to check against if (!skipVetoes) { try { VirtualChannel channelToMaster = SlaveComputer.getChannelToMaster(); if (channelToMaster!=null) { CheckVetoes vetoCheck = new CheckVetoes(this); causeMessage = channelToMaster.call(vetoCheck); } } catch (IOException e) { LOGGER.log(Level.WARNING, "I/O Exception while checking for vetoes", e); } catch (InterruptedException e) { LOGGER.log(Level.WARNING, "Interrupted Exception while checking for vetoes", e); } } if (causeMessage != null) { return new VetoCause(causeMessage); } return null; }
VirtualChannel channelToMaster = SlaveComputer.getChannelToMaster(); if (channelToMaster != null) { vetoersExist = channelToMaster.call(new DoVetoersExist());
/** * Obtains the list of killers. */ /*package*/ final List<ProcessKiller> getKillers() throws InterruptedException { if (killers==null) try { killers = SlaveComputer.getChannelToMaster().call(new Callable<List<ProcessKiller>, IOException>() { public List<ProcessKiller> call() throws IOException { return new ArrayList<ProcessKiller>(ProcessKiller.all()); } }); } catch (IOException e) { LOGGER.log(Level.WARNING, "Failed to obtain killers",e); killers = Collections.emptyList(); } return killers; }
/** * Obtains the list of killers. */ /*package*/ final List<ProcessKiller> getKillers() throws InterruptedException { if (killers==null) try { killers = SlaveComputer.getChannelToMaster().call(new Callable<List<ProcessKiller>, IOException>() { public List<ProcessKiller> call() throws IOException { return new ArrayList<ProcessKiller>(ProcessKiller.all()); } }); } catch (IOException e) { LOGGER.log(Level.WARNING, "Failed to obtain killers",e); killers = Collections.emptyList(); } return killers; }
/** * Obtains the list of killers. */ /*package*/ final List<ProcessKiller> getKillers() throws InterruptedException { if (killers==null) try { killers = SlaveComputer.getChannelToMaster().call(new Callable<List<ProcessKiller>, IOException>() { public List<ProcessKiller> call() throws IOException { return new ArrayList<ProcessKiller>(ProcessKiller.all()); } }); } catch (IOException e) { logger.info("Failed to obtain killers (process started by build) ",e); killers = Collections.emptyList(); } return killers; }
/** * Obtains the list of killers. */ /*package*/ final List<ProcessKiller> getKillers() throws InterruptedException { if (killers == null) { try { killers = SlaveComputer.getChannelToMaster().call(new Callable<List<ProcessKiller>, IOException>() { public List<ProcessKiller> call() throws IOException { return new ArrayList<ProcessKiller>(ProcessKiller.all()); } }); } catch (IOException e) { logger.info("Failed to obtain killers (process started by build) ", e); killers = Collections.emptyList(); } } return killers; }
/** * Obtains the list of killers. */ /*package*/ final List<ProcessKiller> getKillers() throws InterruptedException { if (killers==null) try { VirtualChannel channelToMaster = SlaveComputer.getChannelToMaster(); if (channelToMaster!=null) { killers = channelToMaster.call(new SlaveToMasterCallable<List<ProcessKiller>, IOException>() { public List<ProcessKiller> call() throws IOException { return new ArrayList<ProcessKiller>(ProcessKiller.all()); } }); } else { // used in an environment that doesn't support talk-back to the master. // let's do with what we have. killers = Collections.emptyList(); } } catch (IOException e) { LOGGER.log(Level.WARNING, "Failed to obtain killers",e); killers = Collections.emptyList(); } return killers; }