protected ConfigurationNode getNode(ServletContext servletContext) throws Exception { return ServletConfigUtil.findConfigurationNode(servletContext, getOa4mpConfigFileKey(), getOa4mpConfigNameKey(), OA4MPConfigTags.COMPONENT); }
@Override public ConfigurationLoader getConfigurationLoader(ServletContext servletContext) throws Exception { MyLoggingFacade logger = new MyLoggingFacade(getClass().getSimpleName()); logger.info("Starting to load configuration"); try { ConfigurationLoader x = getConfigurationLoader( ServletConfigUtil.findConfigurationNode(servletContext, getOa4mpConfigFileKey(), getOa4mpConfigNameKey(), ClientXMLTags.COMPONENT)); logger.info("Loaded configuration named " + servletContext.getInitParameter(getOa4mpConfigNameKey()) + " from file " + servletContext.getInitParameter(getOa4mpConfigFileKey())); return x; } catch (MyConfigurationException ce) { logger.info("Did not find a configuration via the servlet context:" + ce.getMessage()); } logger.info("No configuration found in servlet context. Trying default locations"); // That didn't work, so try to look for it in a few other places. String configName = servletContext.getInitParameter(getOa4mpConfigNameKey()); ConfigurationLoader loader = loadFromDefaultLocations(logger, configName); if (loader != null) { return loader; } MyConfigurationException cx = new MyConfigurationException("Error: No configuration found anyplace. OA4MP client startup aborted!"); logger.error(cx); throw cx; }