Example #1
0
 private void showLoggers(CLIContext cli) {
   NameRegistrar nr = NameRegistrar.getInstance();
   int maxw = 0;
   Iterator iter = NameRegistrar.getAsMap().entrySet().iterator();
   StringBuilder sb = new StringBuilder("available loggers:");
   while (iter.hasNext()) {
     Map.Entry entry = (Map.Entry) iter.next();
     String key = (String) entry.getKey();
     if (key.startsWith("logger.") && entry.getValue() instanceof Logger) {
       sb.append(' ');
       sb.append(key.substring(7));
     }
   }
   cli.println(sb.toString());
 }
Example #2
0
 private void showTMs(CLIContext cli) {
   NameRegistrar nr = NameRegistrar.getInstance();
   int maxw = 0;
   Iterator iter = NameRegistrar.getAsMap().entrySet().iterator();
   StringBuilder sb = new StringBuilder("available transaction managers:");
   while (iter.hasNext()) {
     Map.Entry entry = (Map.Entry) iter.next();
     String key = (String) entry.getKey();
     if (entry.getValue() instanceof TransactionManager) {
       sb.append(' ');
       sb.append(key);
     }
   }
   cli.println(sb.toString());
 }