示例#1
0
文件: TMMON.java 项目: Zengwn/jPOS
 private void showTMs(CLIContext cli) {
   NameRegistrar nr = NameRegistrar.getInstance();
   int maxw = 0;
   Iterator iter = NameRegistrar.getMap().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());
 }
示例#2
0
文件: TAIL.java 项目: juanibdn/jPOS
 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());
 }