use of org.apache.commons.chain.config.ConfigParser in project sonar-java by SonarSource.
the class ActionServlet method initChain.
/**
* <p>Parse the configuration documents specified by the
* <code>chainConfig</code> init-param to configure the default {@link
* org.apache.commons.chain.Catalog} that is registered in the {@link
* CatalogFactory} instance for this application.</p>
*
* @throws ServletException if an error occurs.
*/
protected void initChain() throws ServletException {
// Parse the configuration file specified by path or resource
try {
String value;
value = getServletConfig().getInitParameter("chainConfig");
if (value != null) {
chainConfig = value;
}
ConfigParser parser = new ConfigParser();
List urls = splitAndResolvePaths(chainConfig);
URL resource;
for (Iterator i = urls.iterator(); i.hasNext(); ) {
resource = (URL) i.next();
log.info("Loading chain catalog from " + resource);
parser.parse(resource);
}
} catch (Exception e) {
log.error("Exception loading resources", e);
throw new ServletException(e);
}
}
use of org.apache.commons.chain.config.ConfigParser in project sonarqube by SonarSource.
the class ActionServlet method initChain.
/**
* <p>Parse the configuration documents specified by the
* <code>chainConfig</code> init-param to configure the default {@link
* org.apache.commons.chain.Catalog} that is registered in the {@link
* CatalogFactory} instance for this application.</p>
*
* @throws ServletException if an error occurs.
*/
protected void initChain() throws ServletException {
// Parse the configuration file specified by path or resource
try {
String value;
value = getServletConfig().getInitParameter("chainConfig");
if (value != null) {
chainConfig = value;
}
ConfigParser parser = new ConfigParser();
List urls = splitAndResolvePaths(chainConfig);
URL resource;
for (Iterator i = urls.iterator(); i.hasNext(); ) {
resource = (URL) i.next();
log.info("Loading chain catalog from " + resource);
parser.parse(resource);
}
} catch (Exception e) {
log.error("Exception loading resources", e);
throw new ServletException(e);
}
}
use of org.apache.commons.chain.config.ConfigParser in project bamboobsc by billchen198318.
the class SimpleChain method getCatalog.
public Catalog getCatalog(String resourceConfig, String catalogName) throws Exception {
ConfigParser parser = new ConfigParser();
parser.parse(this.getClass().getResource(resourceConfig));
Catalog catalog = CatalogFactoryBase.getInstance().getCatalog(catalogName);
return catalog;
}
Aggregations