protected void initContainerConfig() { containerConfig = new HashMap<String, String>(); for (Map.Entry<String, String> entry : ConfigResolver.getAllProperties().entrySet()) { if (entry.getKey().startsWith("org.apache.myfaces.") || entry.getKey().startsWith("javax.faces.") || entry.getKey().startsWith("facelets.")) { containerConfig.put(entry.getKey(), entry.getValue()); } } }
protected void initContainerConfig() { containerConfig = new HashMap<String, String>(); for (Map.Entry<String, String> entry : ConfigResolver.getAllProperties().entrySet()) { if (entry.getKey().startsWith("org.apache.myfaces.") || entry.getKey().startsWith("javax.faces.") || entry.getKey().startsWith("facelets.")) { containerConfig.put(entry.getKey(), entry.getValue()); } } }
/** * Load additional configuration from the Configuration system * and overload the basic settings with that info. * * The key is deltaspike.persistence.config.${persistenceUnitName}.${originalKey} * * @see #CONFIG_PREFIX * @since 1.8.0 */ protected Properties addConfigProperties(Properties unitProperties, String persistenceUnitName) { // we start with a copy of the original properties Properties mergedConfig = new Properties(); mergedConfig.putAll(unitProperties); Set<String> allConfigKeys = ConfigResolver.getAllProperties().keySet(); String unitPrefix = CONFIG_PREFIX + persistenceUnitName + "."; for (String configKey : allConfigKeys) { if (configKey.startsWith(unitPrefix)) { mergedConfig.put(configKey.substring(unitPrefix.length()), ConfigResolver.getProjectStageAwarePropertyValue(configKey)); } } return mergedConfig; } }
Map<String, String> allProperties = ConfigResolver.getAllProperties(); for (Map.Entry<String, String> property : allProperties.entrySet())
if (isGlobalAlternativeActivated) Map<String, String> allProperties = ConfigResolver.getAllProperties(); for (Map.Entry<String, String> property : allProperties.entrySet())
private List<ConfigEntry> calculateConfigEntries() { Map<String, String> allProperties = ConfigResolver.getAllProperties(); List<ConfigEntry> configEntries = new ArrayList<ConfigEntry>(allProperties.size()); ConfigSource[] configSources = ConfigResolver.getConfigSources(); for (Map.Entry<String, String> configEntry : allProperties.entrySet()) { String key = configEntry.getKey(); String value = ConfigResolver.filterConfigValueForLog(key, ConfigResolver.getProjectStageAwarePropertyValue(key)); String fromConfigSource = getFromConfigSource(configSources, key); configEntries.add(new ConfigEntry(key, value, fromConfigSource)); } return configEntries; }
public void init() { Set<String> ruleConfigKeys = new HashSet<String>(); // first we collect all the rule property names for (String propertyName : ConfigResolver.getAllProperties().keySet()) { if (propertyName.startsWith(CoreBaseConfig.InterDynCustomization.INTERDYN_RULE_PREFIX) && propertyName.contains(".match")) { ruleConfigKeys.add(propertyName.substring(0, propertyName.indexOf(".match"))); } } for (String ruleConfigKey : ruleConfigKeys) { String match = ConfigResolver.getPropertyValue(ruleConfigKey + ".match"); String annotationClassName = ConfigResolver.getPropertyValue(ruleConfigKey + ".annotation"); if (match != null && annotationClassName != null && match.length() > 0 && annotationClassName.length() > 0) { Annotation anno = getAnnotationImplementation(annotationClassName); boolean requiresProxy = anno.annotationType().getAnnotation(InterceptorBinding.class) != null; interceptorRules.add(new AnnotationRule(match, anno, requiresProxy)); } } if (interceptorRules.isEmpty()) { enabled = false; } }
private void logConfiguration() { Boolean logConfig = ConfigResolver.resolve(ConfigResolver.DELTASPIKE_LOG_CONFIG).as(Boolean.class).getValue(); if (logConfig != null && logConfig && LOG.isLoggable(Level.INFO)) { StringBuilder sb = new StringBuilder(1 << 16); // first log out the config sources in descendent ordinal order sb.append("ConfigSources: "); ConfigSource[] configSources = ConfigResolver.getConfigSources(); for (ConfigSource configSource : configSources) { sb.append("\n\t").append(configSource.getOrdinal()).append(" - ").append(configSource.getConfigName()); } // and all the entries in no guaranteed order Map<String, String> allProperties = ConfigResolver.getAllProperties(); sb.append("\n\nConfigured Values:"); for (Map.Entry<String, String> entry : allProperties.entrySet()) { sb.append("\n\t") .append(entry.getKey()) .append(" = ") .append(ConfigResolver.filterConfigValueForLog(entry.getKey(), entry.getValue())); } LOG.info(sb.toString()); } }
private BeanDefinition getPropertyPlaceHolder() { Map<String,String> map = ConfigResolver.getAllProperties(); Properties props = new Properties(); props.putAll(map); GenericBeanDefinition beanDefinition = new GenericBeanDefinition(); beanDefinition.setBeanClass(PropertyPlaceholderConfigurer.class); beanDefinition.setPropertyValues( new MutablePropertyValues() // .add("location", new ClassPathResource("config.properties"))); .add("properties", props)); return beanDefinition; }