final InputSource source = new InputSource(new ByteArrayInputStream(buffer));
source.setSystemId(configSource.getLocation());
final Document document = newDocumentBuilder().parse(source);
rootElement = document.getDocumentElement();
final Map<String, String> attrs = processAttributes(rootNode, rootElement);
final StatusConfiguration statusConfig = new StatusConfiguration().withVerboseClasses(VERBOSE_CLASSES)
.withStatus(getDefaultStatus());
for (final Map.Entry<String, String> entry : attrs.entrySet()) {
final String key = entry.getKey();
final String value = getStrSubstitutor().replace(entry.getValue());
if ("status".equalsIgnoreCase(key)) {
statusConfig.withStatus(value);
} else if ("dest".equalsIgnoreCase(key)) {
statusConfig.withDestination(value);
} else if ("shutdownHook".equalsIgnoreCase(key)) {
isShutdownHookEnabled = !"disable".equalsIgnoreCase(value);
} else if ("verbose".equalsIgnoreCase(key)) {
statusConfig.withVerbosity(value);
} else if ("packages".equalsIgnoreCase(key)) {
final String[] packages = value.split(Patterns.COMMA_SEPARATOR);
for (final String p : packages) {
PluginManager.addPackage(p);
}
} else if ("name".equalsIgnoreCase(key)) {
setName(value);
} else if ("strict".equalsIgnoreCase(key)) {
strict = Boolean.parseBoolean(value);
} else if ("schema".equalsIgnoreCase(key)) {
schema = value;
} else if ("monitorInterval".equalsIgnoreCase(key)) {
final int interval = Integer.parseInt(value);
if (interval > 0 && configFile != null) {
monitor = new FileConfigurationMonitor(this, configFile, listeners, interval);
}
} else if ("advertiser".equalsIgnoreCase(key)) {
createAdvertiser(value, configSource, buffer, "text/xml");
}
}
statusConfig.initialize();
} catch (final SAXException domEx) {
LOGGER.error("Error parsing " + configSource.getLocation(), domEx);
} catch (final IOException ioe) {
LOGGER.error("Error parsing " + configSource.getLocation(), ioe);
} catch (final ParserConfigurationException pex) {