use of org.jpos.util.NameRegistrar in project jPOS by jpos.
the class TMMON method showTMs.
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());
}
use of org.jpos.util.NameRegistrar in project jPOS by jpos.
the class SHOWNR method showAll.
private void showAll(CLIContext cli, boolean detail) {
NameRegistrar nr = NameRegistrar.getInstance();
int maxw = 0;
Iterator iter = NameRegistrar.getAsMap().entrySet().iterator();
while (iter.hasNext()) {
Map.Entry entry = (Map.Entry) iter.next();
maxw = Math.max(maxw, entry.getKey().toString().length());
}
iter = NameRegistrar.getAsMap().entrySet().iterator();
maxw++;
while (iter.hasNext()) {
Map.Entry entry = (Map.Entry) iter.next();
cli.println(ISOUtil.strpad(entry.getKey().toString(), maxw) + entry.getValue().toString());
if (detail && entry.getValue() instanceof Loggeable) {
cli.printLoggeable((Loggeable) entry.getValue(), " ");
}
}
}
use of org.jpos.util.NameRegistrar in project jPOS by jpos.
the class TAIL method showLoggers.
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());
}
Aggregations