コード例 #1
0
 private void error(final int exit_code, final String stderr) {
   Activator.getLogger()
       .log(
           Level.WARNING,
           "Failed to execute command: {0}, exit code: {1}, stderr: {2}",
           new Object[] {command, exit_code, stderr});
 }
コード例 #2
0
 /** {@inheritDoc} */
 @Override
 public void execute(List<PVSnapshot> pvs) throws Exception {
   final String dir;
   try {
     dir = Preferences.getCommandDirectory();
   } catch (Exception ex) {
     Activator.getLogger().log(Level.SEVERE, "Can not find command directory", ex);
     return;
   }
   if (command.contains("*")) { // List PVs and their alarm severity
     final StringBuilder buf = new StringBuilder();
     for (PVSnapshot pv : pvs) {
       if (buf.length() > 0) buf.append(" ");
       buf.append(pv.getPath());
       buf.append(" ");
       buf.append(pv.getSeverity().name());
     }
     final String expanded_command = command.replace("*", buf.toString());
     execCmd(dir, expanded_command, wait);
   } else execCmd(dir, command, wait);
 }