use of com.alibaba.cobar.config.model.ClusterConfig in project cobar by alibaba.
the class XMLServerLoader method load.
private void load() {
InputStream dtd = null;
InputStream xml = null;
try {
dtd = XMLServerLoader.class.getResourceAsStream("/server.dtd");
xml = XMLServerLoader.class.getResourceAsStream("/server.xml");
Element root = ConfigUtil.getDocument(dtd, xml).getDocumentElement();
loadSystem(root);
loadUsers(root);
this.cluster = new ClusterConfig(root, system.getServerPort());
loadQuarantine(root);
} catch (ConfigException e) {
throw e;
} catch (Throwable e) {
throw new ConfigException(e);
} finally {
if (dtd != null) {
try {
dtd.close();
} catch (IOException e) {
}
}
if (xml != null) {
try {
xml.close();
} catch (IOException e) {
}
}
}
}
Aggregations