private void printAttrs(Properties targetAttrs, boolean printTitle) {
CommonCmdRunnerUtil.printAttrs(targetAttrs, printTitle, new BrokerCmdPrinter());
}
private ServiceInfo getServiceInfoFromAttrs(Properties svcAttrs) {
ServiceInfo si = new ServiceInfo();
for (Enumeration e = svcAttrs.propertyNames(); e.hasMoreElements() ;) {
String propName = (String)e.nextElement(),
value = svcAttrs.getProperty(propName);
int intValue = 0;
boolean valueOK = true;
if (propName.equals(PROP_NAME_SVC_PORT)) {
try {
intValue = Integer.parseInt(value);
} catch (NumberFormatException nfe) {
valueOK = false;
}
if (valueOK) {
si.setPort(intValue);
}
continue;
}
if (propName.equals(PROP_NAME_SVC_MIN_THREADS)) {
try {
intValue = Integer.parseInt(value);
} catch (NumberFormatException nfe) {
valueOK = false;
}
if (valueOK) {
si.setMinThreads(intValue);
}
continue;
}
if (propName.equals(PROP_NAME_SVC_MAX_THREADS)) {
try {
intValue = Integer.parseInt(value);
} catch (NumberFormatException nfe) {
valueOK = false;
}
if (valueOK) {
si.setMaxThreads(intValue);
}
continue;
}
}