@Override protected void executeCommand(AdminCommandContext context, Properties extraProps) throws Exception { ColumnFormatter columnFormatter = new ColumnFormatter(getDisplayHeaders()); List<Map<String, Object>> jobExecutions = new ArrayList<>(); extraProps.put("listBatchJobSteps", jobExecutions); for (StepExecution je : findStepExecutions()) { try { jobExecutions.add(handleJob(je, columnFormatter)); } catch (Exception ex) { logger.log(Level.WARNING, "Exception while getting jobExecution details: " + ex); logger.log(Level.FINE, "Exception while getting jobExecution details ", ex); } } context.getActionReport().setMessage(columnFormatter.toString()); }
@Override protected void executeCommand(AdminCommandContext context, Properties extraProps) throws Exception { ColumnFormatter columnFormatter = new ColumnFormatter(getDisplayHeaders()); if (isSimpleMode()) { extraProps.put("simpleMode", true); extraProps.put("listBatchJobs", findSimpleJobInfo(columnFormatter)); } else { extraProps.put("simpleMode", false); List<Map<String, Object>> jobExecutions = new ArrayList<>(); extraProps.put("listBatchJobs", jobExecutions); for (JobExecution je : findJobExecutions()) { try { if (glassFishBatchSecurityHelper.isVisibleToThisInstance(((TaggedJobExecution) je).getTagName())) jobExecutions.add(handleJob(je, columnFormatter)); } catch (Exception ex) { logger.log(Level.WARNING, "Exception while getting jobExecution details: " + ex); logger.log(Level.FINE, "Exception while getting jobExecution details ", ex); } } } context.getActionReport().setMessage(columnFormatter.toString()); }
public static String formatBrief(List<InstanceInfo> infos) { ColumnFormatter cf = new ColumnFormatter(); for (InstanceInfo info : infos) { cf.addRow(new Object[]{ info.getName(), info.getDisplayState() }); } return cf.toString(); }
sb.append(cf.toString());
context.getActionReport().setMessage(columnFormatter.toString()); } else { throw new RuntimeException("No Job Executions found");
for (Map.Entry e : ((Properties) data).entrySet()) cf.addRow(new String[]{e.getKey().toString(), e.getValue().toString()}); st = new StringTokenizer(cf.toString(), "\n"); break; case STEP_COUNT:
}); logger.info(cf.toString()); } else { for (String dn : domainsList) {
context.getActionReport().setMessage(columnFormatter.toString());
cf.addRow(new Object[] {metric.getType().name(), metric.getValue()}); st = new StringTokenizer(cf.toString(), "\n");
report.appendMessage(colfm.toString());
public static String format(List<InstanceInfo> infos) { String headings[] = {NAME, HOST, PORT, PID, CLUSTER, STATE}; ColumnFormatter cf = new ColumnFormatter(headings); for (InstanceInfo info : infos) { cf.addRow(new Object[]{ info.getName(), info.getHost(), info.getPort(), formatPid(info), info.getDisplayCluster(), info.getDisplayState() }); } return cf.toString(); }