@PreDestroy public void unsetProperties() { Properties props = load(PROPERTIES_FILE_NAME); if (props != null) { for (Map.Entry<Object, Object> entry : props.entrySet()) { if (ConfigurationKey.fromString(entry.getKey().toString()) != null) { System.setProperty(entry.getKey().toString(), ConfigurationKey.fromString(entry.getKey().toString()).getDefaultValue().toString()); } else { System.clearProperty(entry.getKey().toString()); } } } }
/** * Process the given string key and value. First try to convert the <code>stringKey</code> - unsupported keys are ignored. Then delegate to * {@link #processKeyValue(Map, ConfigurationKey, Object)}. * * @param properties * @param stringKey * @param value */ private void processKeyValue(Map<ConfigurationKey, Object> properties, String stringKey, Object value) { ConfigurationKey key = ConfigurationKey.fromString(stringKey); if (key != null) { processKeyValue(properties, key, value); } else { ConfigurationLogger.LOG.unsupportedConfigurationKeyFound(stringKey); } }
private void processKeyValue(Map<ConfigurationKey, Object> properties, String stringKey, Object value, boolean integratorSource) { ConfigurationKey key = ConfigurationKey.fromString(stringKey); if (key != null) { if (key.isIntegratorOnly() && !integratorSource) { ConfigurationLogger.LOG.cannotSetIntegratorOnlyConfigurationProperty(stringKey, value); } else { processKeyValue(properties, key, value); } } else { ConfigurationLogger.LOG.unsupportedConfigurationKeyFound(stringKey); } }
private void processKeyValue(Map<ConfigurationKey, Object> properties, String stringKey, Object value, boolean integratorSource) { ConfigurationKey key = ConfigurationKey.fromString(stringKey); if (key != null) { if (key.isIntegratorOnly() && !integratorSource) { ConfigurationLogger.LOG.cannotSetIntegratorOnlyConfigurationProperty(stringKey, value); } else { processKeyValue(properties, key, value); } } else { ConfigurationLogger.LOG.unsupportedConfigurationKeyFound(stringKey); } }
private void processKeyValue(Map<ConfigurationKey, Object> properties, String stringKey, Object value, boolean integratorSource) { ConfigurationKey key = ConfigurationKey.fromString(stringKey); if (key != null) { if (key.isIntegratorOnly() && !integratorSource) { ConfigurationLogger.LOG.cannotSetIntegratorOnlyConfigurationProperty(stringKey, value); } else { processKeyValue(properties, key, value); } } else { ConfigurationLogger.LOG.unsupportedConfigurationKeyFound(stringKey); } }
private void processKeyValue(Map<ConfigurationKey, Object> properties, String stringKey, Object value, boolean integratorSource) { ConfigurationKey key = ConfigurationKey.fromString(stringKey); if (key != null) { if (key.isIntegratorOnly() && !integratorSource) { ConfigurationLogger.LOG.cannotSetIntegratorOnlyConfigurationProperty(stringKey, value); } else { processKeyValue(properties, key, value); } } else { ConfigurationLogger.LOG.unsupportedConfigurationKeyFound(stringKey); } }
private void processKeyValue(Map<ConfigurationKey, Object> properties, String stringKey, Object value, boolean integratorSource) { ConfigurationKey key = ConfigurationKey.fromString(stringKey); if (key != null) { if (key.isIntegratorOnly() && !integratorSource) { ConfigurationLogger.LOG.cannotSetIntegratorOnlyConfigurationProperty(stringKey, value); } else { processKeyValue(properties, key, value); } } else { ConfigurationLogger.LOG.unsupportedConfigurationKeyFound(stringKey); } }