Refine search
public void setConfigService(ConfigService configService) { this.configService = configService; Config config = this.configService.getConfig("Server"); serverProperties = (ServerConfigElement)config.getConfigElement(ServerConfigElement.CONFIG_ELEMENT_ID); }
/** * Registers this object with the injected ConfigService */ public void register() { if (configService == null) { throw new ConfigException("Config service must be provided"); } configService.addDeployer(this); }
protected boolean isDebugMode() { if (this.isDebugMode == null) { Boolean debugValue = false; if (configService != null) { Config global = configService.getGlobalConfig(); if (global != null) { ConfigElement flags = global.getConfigElement("flags"); if (flags != null) { ConfigElement clientDebug = flags.getChild("client-debug"); if (clientDebug != null) { debugValue = Boolean.valueOf(clientDebug.getValue()); } } } } this.isDebugMode = debugValue; } return this.isDebugMode; }
Config configStandard = configService.getConfig(USED_STANDARD_CONFIG_CONDITION, clContext); && configStandard.getConfigElement(USED_STANDARD_ELEMENT) != null) standard = configStandard.getConfigElement(USED_STANDARD_ELEMENT).getValue(); Config configConditions = configService.getConfig(CONFIG_CONDITION, clContext); Map<String, ConfigElement> configElements = configConditions.getConfigElements(); logger.warn("Ignoring prefered standard doesn't found, choose : " + configLanguages.getName()); List<ConfigElement> languages = configLanguages.getChildren();
Config securityHeadersConfig = (Config) configService.getConfig("SecurityHeadersPolicy"); if (securityHeadersConfig == null) ConfigElement headersConfig = securityHeadersConfig.getConfigElement("headers"); if (headersConfig == null) List<ConfigElement> headersConfigList = headersConfig.getChildren("header"); if (headersConfigList == null || headersConfigList.size() == 0) String name = headerConfig.getChildValue("name"); Header header; if (allHeaders.containsKey(name)) ConfigElement valueConfig = headerConfig.getChild("value"); if (valueConfig != null)
Config csrfConfig = (Config) configService.getConfig("CSRFPolicy"); if (csrfConfig == null || !enabled) ConfigElement sessionConfig = csrfConfig.getConfigElement("session"); createSession = (sessionConfig != null && "true".equals(sessionConfig.getValue())); if (createSession && logger.isDebugEnabled()) logger.debug("The CSRFFilter will automatically create a user Session on a path match."); ConfigElement propertiesConfig = csrfConfig.getConfigElement("properties"); if (propertiesConfig != null) List<ConfigElement> propertiesConfigList = propertiesConfig.getChildren(); String value; if (propertiesConfigList != null && propertiesConfigList.size() > 0) value = propertyConfig.getValue(); properties.put(propertyConfig.getName(), value != null ? value : ""); ConfigElement filterConfig = csrfConfig.getConfigElement("filter"); if (filterConfig == null)
@Override public Object get(Object identifier) { if (logger.isDebugEnabled()) logger.debug("Getting scoped config for '" + identifier + "'"); Map<String, ConfigElement> map = null; if (configService != null) { Config result = configService.getConfig(identifier); map = result.getConfigElements(); } else { map = Collections.emptyMap(); } if (logger.isDebugEnabled()) logger.debug("Returning config for '" + identifier + "': " + map); return map; } }
/** * Retrieves the global configuration as a Map. * * @return Map of the global config */ public Map<String, ConfigElement> getGlobal() { if (this.globalConfig == null) { if (this.configService != null) { // get the global config this.globalConfig = this.configService.getGlobalConfig().getConfigElements(); } // if no global config was found create an empty map if (this.globalConfig == null) { this.globalConfig = Collections.emptyMap(); } } return this.globalConfig; }
/** * Method called by ConfigService when the configuration files * represented by this ConfigDeployer need to be initialised. * * @return List of ConfigDeployment objects */ public List<ConfigDeployment> initConfig() { List<ConfigDeployment> deployed = null; if (configService != null && this.configs != null && this.configs.size() != 0) { UrlConfigSource configSource = new UrlConfigSource(this.configs, true); deployed = configService.appendConfig(configSource); } return deployed; }
public void reset() { long startTime = System.nanoTime(); try { scriptProcessorRegistry.reset(); templateProcessorRegistry.reset(); getRegistry().reset(); configService.reset(); } finally { if (logger.isInfoEnabled()) logger.info("Initialised " + getName() + " Web Script Container (in " + (System.nanoTime() - startTime)/1000000f + "ms)"); } }
Config configStandard = configService.getConfig(USED_STANDARD_CONFIG_CONDITION, clContext); && configStandard.getConfigElement(USED_STANDARD_ELEMENT) != null) standard = configStandard.getConfigElement(USED_STANDARD_ELEMENT).getValue(); Config configConditions = configService.getConfig(CONFIG_CONDITION, clContext); Map<String, ConfigElement> configElements = configConditions.getConfigElements(); logger.warn("Ignoring prefered standard doesn't found, choose : " + configLanguages.getName()); List<ConfigElement> languages = configLanguages.getChildren();
@Override public Object get(Object identifier) { if (logger.isDebugEnabled()) logger.debug("Getting scoped config for '" + identifier + "'"); Map<String, ConfigElement> map = null; if (configService != null) { Config result = configService.getConfig(identifier); map = result.getConfigElements(); } else { map = Collections.emptyMap(); } if (logger.isDebugEnabled()) logger.debug("Returning config for '" + identifier + "': " + map); return map; } }
/** * Retrieves the global configuration as a Map. * * @return Map of the global config */ public Map<String, ConfigElement> getGlobal() { if (this.globalConfig == null) { if (this.configService != null) { // get the global config this.globalConfig = this.configService.getGlobalConfig().getConfigElements(); } // if no global config was found create an empty map if (this.globalConfig == null) { this.globalConfig = Collections.emptyMap(); } } return this.globalConfig; }
/** * Method called by ConfigService when the configuration files * represented by this ConfigDeployer need to be initialised. * * @return List of ConfigDeployment objects */ public List<ConfigDeployment> initConfig() { List<ConfigDeployment> deployed = null; if (configService != null && this.configs != null && this.configs.size() != 0) { UrlConfigSource configSource = new UrlConfigSource(this.configs, true); deployed = configService.appendConfig(configSource); } return deployed; }
public void reset() { long startTime = System.nanoTime(); try { scriptProcessorRegistry.reset(); templateProcessorRegistry.reset(); getRegistry().reset(); configService.reset(); } finally { if (logger.isInfoEnabled()) logger.info("Initialised " + getName() + " Web Script Container (in " + (System.nanoTime() - startTime)/1000000f + "ms)"); } }
public void setConfigService(ConfigService configService) { this.configService = configService; Config config = this.configService.getConfig("Server"); serverProperties = (ServerConfigElement)config.getConfigElement(ServerConfigElement.CONFIG_ELEMENT_ID); }
protected boolean isDebugMode() { if (this.isDebugMode == null) { Boolean debugValue = false; if (configService != null) { Config global = configService.getGlobalConfig(); if (global != null) { ConfigElement flags = global.getConfigElement("flags"); if (flags != null) { ConfigElement clientDebug = flags.getChild("client-debug"); if (clientDebug != null) { debugValue = Boolean.valueOf(clientDebug.getValue()); } } } } this.isDebugMode = debugValue; } return this.isDebugMode; }
@Override public Object get(Object identifier) { if (logger.isDebugEnabled()) logger.debug("Getting scoped config for '" + identifier + "'"); Map<String, ConfigElement> map = null; if (configService != null) { Config result = configService.getConfig(identifier); map = result.getConfigElements(); } else { map = Collections.emptyMap(); } if (logger.isDebugEnabled()) logger.debug("Returning config for '" + identifier + "': " + map); return map; } }
/** * Retrieves the global configuration as a Map. * * @return Map of the global config */ public Map<String, ConfigElement> getGlobal() { if (this.globalConfig == null) { if (this.configService != null) { // get the global config this.globalConfig = this.configService.getGlobalConfig().getConfigElements(); } // if no global config was found create an empty map if (this.globalConfig == null) { this.globalConfig = Collections.emptyMap(); } } return this.globalConfig; }
/** * Registers this object with the injected ConfigService */ public void register() { if (configService == null) { throw new ConfigException("Config service must be provided"); } configService.addDeployer(this); }