You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@karaf.apache.org by jb...@apache.org on 2012/11/05 11:56:04 UTC
svn commit: r1405743 - in
/karaf/cellar/branches/cellar-2.3.x/config/src/main/java/org/apache/karaf/cellar/config:
./ shell/
Author: jbonofre
Date: Mon Nov 5 10:56:03 2012
New Revision: 1405743
URL: http://svn.apache.org/viewvc?rev=1405743&view=rev
Log:
[KARAF-1998] Remove the karaf.cellar.sync property and compare the distributed and local configurations
Modified:
karaf/cellar/branches/cellar-2.3.x/config/src/main/java/org/apache/karaf/cellar/config/ConfigurationEventHandler.java
karaf/cellar/branches/cellar-2.3.x/config/src/main/java/org/apache/karaf/cellar/config/ConfigurationSupport.java
karaf/cellar/branches/cellar-2.3.x/config/src/main/java/org/apache/karaf/cellar/config/ConfigurationSynchronizer.java
karaf/cellar/branches/cellar-2.3.x/config/src/main/java/org/apache/karaf/cellar/config/Constants.java
karaf/cellar/branches/cellar-2.3.x/config/src/main/java/org/apache/karaf/cellar/config/LocalConfigurationListener.java
karaf/cellar/branches/cellar-2.3.x/config/src/main/java/org/apache/karaf/cellar/config/shell/ConfigCommandSupport.java
karaf/cellar/branches/cellar-2.3.x/config/src/main/java/org/apache/karaf/cellar/config/shell/DeleteCommand.java
karaf/cellar/branches/cellar-2.3.x/config/src/main/java/org/apache/karaf/cellar/config/shell/ListCommand.java
karaf/cellar/branches/cellar-2.3.x/config/src/main/java/org/apache/karaf/cellar/config/shell/PropAppendCommand.java
karaf/cellar/branches/cellar-2.3.x/config/src/main/java/org/apache/karaf/cellar/config/shell/PropListCommand.java
karaf/cellar/branches/cellar-2.3.x/config/src/main/java/org/apache/karaf/cellar/config/shell/PropSetCommand.java
Modified: karaf/cellar/branches/cellar-2.3.x/config/src/main/java/org/apache/karaf/cellar/config/ConfigurationEventHandler.java
URL: http://svn.apache.org/viewvc/karaf/cellar/branches/cellar-2.3.x/config/src/main/java/org/apache/karaf/cellar/config/ConfigurationEventHandler.java?rev=1405743&r1=1405742&r2=1405743&view=diff
==============================================================================
--- karaf/cellar/branches/cellar-2.3.x/config/src/main/java/org/apache/karaf/cellar/config/ConfigurationEventHandler.java (original)
+++ karaf/cellar/branches/cellar-2.3.x/config/src/main/java/org/apache/karaf/cellar/config/ConfigurationEventHandler.java Mon Nov 5 10:56:03 2012
@@ -59,34 +59,35 @@ public class ConfigurationEventHandler e
Group group = event.getSourceGroup();
String groupName = group.getName();
- Map<String, Properties> configurationTable = clusterManager.getMap(Constants.CONFIGURATION_MAP + Configurations.SEPARATOR + groupName);
+ Map<String, Properties> distributedConfigurations = clusterManager.getMap(Constants.CONFIGURATION_MAP + Configurations.SEPARATOR + groupName);
String pid = event.getId();
if (isAllowed(event.getSourceGroup(), Constants.CATEGORY, pid, EventType.INBOUND)) {
- Properties remoteDictionary = configurationTable.get(pid);
+
+ Properties distributedDictionary = distributedConfigurations.get(pid);
Configuration conf;
try {
// update the local configuration
conf = configurationAdmin.getConfiguration(pid, null);
- if (conf != null) {
if (event.getType() == ConfigurationEvent.CM_DELETED) {
if (conf.getProperties() != null) {
+ // delete the properties
conf.delete();
deleteStorage(pid);
}
} else {
- if (remoteDictionary != null) {
- remoteDictionary.put(Constants.SYNC_PROPERTY, new Long(System.currentTimeMillis()).toString());
+ if (distributedDictionary != null) {
Dictionary localDictionary = conf.getProperties();
if (localDictionary == null)
localDictionary = new Properties();
- filter(remoteDictionary, localDictionary);
- conf.update(localDictionary);
- persistConfiguration(configurationAdmin, pid, localDictionary);
+ localDictionary = filter(localDictionary);
+ if (!equals(distributedDictionary, localDictionary)) {
+ conf.update(distributedDictionary);
+ persistConfiguration(configurationAdmin, pid, distributedDictionary);
+ }
}
}
- }
} catch (IOException ex) {
LOGGER.error("CELLAR CONFIG: failed to read distributed map", ex);
}
Modified: karaf/cellar/branches/cellar-2.3.x/config/src/main/java/org/apache/karaf/cellar/config/ConfigurationSupport.java
URL: http://svn.apache.org/viewvc/karaf/cellar/branches/cellar-2.3.x/config/src/main/java/org/apache/karaf/cellar/config/ConfigurationSupport.java?rev=1405743&r1=1405742&r2=1405743&view=diff
==============================================================================
--- karaf/cellar/branches/cellar-2.3.x/config/src/main/java/org/apache/karaf/cellar/config/ConfigurationSupport.java (original)
+++ karaf/cellar/branches/cellar-2.3.x/config/src/main/java/org/apache/karaf/cellar/config/ConfigurationSupport.java Mon Nov 5 10:56:03 2012
@@ -38,22 +38,83 @@ public class ConfigurationSupport extend
protected File storage;
/**
+ * Reads a {@code Dictionary} object and creates a property object out of it.
+ *
+ * @param dictionary
+ * @return
+ */
+ public Properties dictionaryToProperties(Dictionary dictionary) {
+ Properties properties = new Properties();
+ if (dictionary != null && dictionary.keys() != null) {
+
+ Enumeration keys = dictionary.keys();
+ while (keys.hasMoreElements()) {
+ String key = (String) keys.nextElement();
+ if (key != null && dictionary.get(key) != null) {
+ String value = (String) dictionary.get(key);
+ properties.put(key, dictionary.get(key));
+ }
+ }
+ }
+ return properties;
+ }
+
+ /**
+ * Returns true if dictionaries are equal.
+ *
+ * @param source the first dictionary
+ * @param target the second dictionary
+ * @return true if the two dictionaries are equal, false else.
+ */
+ protected boolean equals(Dictionary source, Dictionary target) {
+ if (source == null && target == null)
+ return true;
+
+ if (source == null || target == null)
+ return false;
+
+ if (source.isEmpty() && target.isEmpty())
+ return true;
+
+ Enumeration sourceKeys = source.keys();
+ while (sourceKeys.hasMoreElements()) {
+ String key = (String) sourceKeys.nextElement();
+ String sourceValue = String.valueOf(source.get(key));
+ String targetValue = String.valueOf(target.get(key));
+ if (sourceValue != null && targetValue == null)
+ return false;
+ if (sourceValue == null && targetValue != null)
+ return false;
+ if (!sourceValue.equals(targetValue))
+ return false;
+ }
+
+ if (source.size() != target.size())
+ return false;
+
+ return true;
+ }
+
+ /**
* Filter a dictionary, and populate a target dictionary.
*
- * @param source the source dictionary.
- * @param target the target dictionary
+ * @param dictionary the source dictionary.
+ * @return the filtered dictionary
*/
- public void filter(Dictionary source, Dictionary target) {
- if (source != null) {
- Enumeration enumaration = source.keys();
- while (enumaration.hasMoreElements()) {
- String key = (String) enumaration.nextElement();
+
+ public Dictionary filter(Dictionary dictionary) {
+ Dictionary result = new Properties();
+ if (dictionary != null) {
+ Enumeration sourceKeys = dictionary.keys();
+ while (sourceKeys.hasMoreElements()) {
+ String key = (String) sourceKeys.nextElement();
if (!isExcludedProperty(key)) {
- String value = String.valueOf(source.get(key));
- target.put(key, value);
+ String value = String.valueOf(dictionary.get(key));
+ result.put(key, value);
}
}
}
+ return result;
}
/**
Modified: karaf/cellar/branches/cellar-2.3.x/config/src/main/java/org/apache/karaf/cellar/config/ConfigurationSynchronizer.java
URL: http://svn.apache.org/viewvc/karaf/cellar/branches/cellar-2.3.x/config/src/main/java/org/apache/karaf/cellar/config/ConfigurationSynchronizer.java?rev=1405743&r1=1405742&r2=1405743&view=diff
==============================================================================
--- karaf/cellar/branches/cellar-2.3.x/config/src/main/java/org/apache/karaf/cellar/config/ConfigurationSynchronizer.java (original)
+++ karaf/cellar/branches/cellar-2.3.x/config/src/main/java/org/apache/karaf/cellar/config/ConfigurationSynchronizer.java Mon Nov 5 10:56:03 2012
@@ -76,25 +76,27 @@ public class ConfigurationSynchronizer e
public void pull(Group group) {
if (group != null) {
String groupName = group.getName();
- Map<String, Properties> configurationTable = clusterManager.getMap(Constants.CONFIGURATION_MAP + Configurations.SEPARATOR + groupName);
+ Map<String, Properties> distributedConfigurations = clusterManager.getMap(Constants.CONFIGURATION_MAP + Configurations.SEPARATOR + groupName);
ClassLoader originalClassLoader = Thread.currentThread().getContextClassLoader();
try {
Thread.currentThread().setContextClassLoader(getClass().getClassLoader());
- for (String pid : configurationTable.keySet()) {
+ for (String pid : distributedConfigurations.keySet()) {
if (isAllowed(group, Constants.CATEGORY, pid, EventType.INBOUND)) {
- Properties remoteDictionary = configurationTable.get(pid);
+ Dictionary remoteDictionary = distributedConfigurations.get(pid);
try {
// update the local configuration if needed
Configuration conf = configurationAdmin.getConfiguration(pid, null);
- remoteDictionary.put(Constants.SYNC_PROPERTY, new Long(System.currentTimeMillis()).toString());
Dictionary localDictionary = conf.getProperties();
if (localDictionary == null)
localDictionary = new Properties();
- filter(remoteDictionary, localDictionary);
- conf.update(localDictionary);
- persistConfiguration(configurationAdmin, pid, localDictionary);
+
+ localDictionary = filter(localDictionary);
+ if (!equals(localDictionary, remoteDictionary)) {
+ conf.update(localDictionary);
+ persistConfiguration(configurationAdmin, pid, localDictionary);
+ }
} catch (IOException ex) {
LOGGER.error("CELLAR CONFIG: failed to read from the distributed map", ex);
}
@@ -120,7 +122,7 @@ public class ConfigurationSynchronizer e
if (group != null) {
String groupName = group.getName();
- Map<String, Properties> configurationTable = clusterManager.getMap(Constants.CONFIGURATION_MAP + Configurations.SEPARATOR + groupName);
+ Map<String, Properties> distributedConfigurations = clusterManager.getMap(Constants.CONFIGURATION_MAP + Configurations.SEPARATOR + groupName);
ClassLoader originalClassLoader = Thread.currentThread().getContextClassLoader();
try {
@@ -132,12 +134,9 @@ public class ConfigurationSynchronizer e
String pid = conf.getPid();
if (isAllowed(group, Constants.CATEGORY, pid, EventType.OUTBOUND)) {
Dictionary localDictionary = conf.getProperties();
- if (localDictionary == null)
- localDictionary = new Properties();
- Properties localProperties = new Properties();
- filter(localDictionary, localProperties);
+ localDictionary = filter(localDictionary);
// update the distributed map
- configurationTable.put(pid, localProperties);
+ distributedConfigurations.put(pid, dictionaryToProperties(localDictionary));
// broadcast the cluster event
RemoteConfigurationEvent event = new RemoteConfigurationEvent(pid);
event.setSourceGroup(group);
Modified: karaf/cellar/branches/cellar-2.3.x/config/src/main/java/org/apache/karaf/cellar/config/Constants.java
URL: http://svn.apache.org/viewvc/karaf/cellar/branches/cellar-2.3.x/config/src/main/java/org/apache/karaf/cellar/config/Constants.java?rev=1405743&r1=1405742&r2=1405743&view=diff
==============================================================================
--- karaf/cellar/branches/cellar-2.3.x/config/src/main/java/org/apache/karaf/cellar/config/Constants.java (original)
+++ karaf/cellar/branches/cellar-2.3.x/config/src/main/java/org/apache/karaf/cellar/config/Constants.java Mon Nov 5 10:56:03 2012
@@ -20,6 +20,5 @@ public class Constants {
public static final String CATEGORY = "config";
public static final String CONFIGURATION_MAP = "org.apache.karaf.cellar.configuration.map";
- public static final String SYNC_PROPERTY = "karaf.cellar.sync";
}
Modified: karaf/cellar/branches/cellar-2.3.x/config/src/main/java/org/apache/karaf/cellar/config/LocalConfigurationListener.java
URL: http://svn.apache.org/viewvc/karaf/cellar/branches/cellar-2.3.x/config/src/main/java/org/apache/karaf/cellar/config/LocalConfigurationListener.java?rev=1405743&r1=1405742&r2=1405743&view=diff
==============================================================================
--- karaf/cellar/branches/cellar-2.3.x/config/src/main/java/org/apache/karaf/cellar/config/LocalConfigurationListener.java (original)
+++ karaf/cellar/branches/cellar-2.3.x/config/src/main/java/org/apache/karaf/cellar/config/LocalConfigurationListener.java Mon Nov 5 10:56:03 2012
@@ -39,8 +39,6 @@ public class LocalConfigurationListener
private static final transient Logger LOGGER = LoggerFactory.getLogger(LocalConfigurationListener.class);
- private static final long SYNC_TIMEOUT = 200;
-
private EventProducer eventProducer;
/**
@@ -61,22 +59,13 @@ public class LocalConfigurationListener
Dictionary localDictionary = null;
if (event.getType() != ConfigurationEvent.CM_DELETED) {
- Configuration conf = null;
try {
- conf = configurationAdmin.getConfiguration(pid, null);
+ Configuration conf = configurationAdmin.getConfiguration(pid, null);
+ localDictionary = conf.getProperties();
} catch (Exception e) {
LOGGER.error("CELLAR CONFIG: can't retrieve configuration with PID {}", pid, e);
return;
}
-
- localDictionary = conf.getProperties();
- if (localDictionary.get(Constants.SYNC_PROPERTY) != null) {
- Long syncTimestamp = new Long((String) localDictionary.get(Constants.SYNC_PROPERTY));
- Long currentTimestamp = System.currentTimeMillis();
- if ((currentTimestamp - syncTimestamp) <= SYNC_TIMEOUT) {
- return;
- }
- }
}
Set<Group> groups = groupManager.listLocalGroups();
@@ -87,31 +76,37 @@ public class LocalConfigurationListener
if (isAllowed(group, Constants.CATEGORY, pid, EventType.OUTBOUND)) {
// update the distributed map if needed
- Map<String, Properties> configurationTable = clusterManager.getMap(Constants.CONFIGURATION_MAP + Configurations.SEPARATOR + group.getName());
+ Map<String, Properties> distributedConfigurations = clusterManager.getMap(Constants.CONFIGURATION_MAP + Configurations.SEPARATOR + group.getName());
+ // broadcast the cluster event
try {
if (event.getType() == ConfigurationEvent.CM_DELETED) {
// update the distributed map
- configurationTable.remove(pid);
+ distributedConfigurations.remove(pid);
// broadcast the cluster event
RemoteConfigurationEvent remoteConfigurationEvent = new RemoteConfigurationEvent(pid);
remoteConfigurationEvent.setType(ConfigurationEvent.CM_DELETED);
+ remoteConfigurationEvent.setSourceNode(clusterManager.getNode());
remoteConfigurationEvent.setSourceGroup(group);
eventProducer.produce(remoteConfigurationEvent);
} else {
- Properties localProperties = new Properties();
- filter(localDictionary, localProperties);
- // update the distributed map
- configurationTable.put(pid, localProperties);
- // broadcast the cluster event
- RemoteConfigurationEvent remoteConfigurationEvent = new RemoteConfigurationEvent(pid);
- remoteConfigurationEvent.setSourceGroup(group);
- eventProducer.produce(remoteConfigurationEvent);
+ localDictionary = filter(localDictionary);
+
+ Properties distributedDictionary = distributedConfigurations.get(pid);
+
+ if (!equals(localDictionary, distributedDictionary)) {
+ // update the distributed map
+ distributedConfigurations.put(pid, dictionaryToProperties(localDictionary));
+ // broadcast the cluster event
+ RemoteConfigurationEvent remoteConfigurationEvent = new RemoteConfigurationEvent(pid);
+ remoteConfigurationEvent.setSourceGroup(group);
+ remoteConfigurationEvent.setSourceNode(clusterManager.getNode());
+ eventProducer.produce(remoteConfigurationEvent);
+ }
}
} catch (Exception e) {
LOGGER.error("CELLAR CONFIG: failed to push configuration with PID {} to the distributed map", pid, e);
}
- // broadcast the cluster event
} else LOGGER.warn("CELLAR CONFIG: configuration with PID {} is marked as BLOCKED OUTBOUND", pid);
}
}
Modified: karaf/cellar/branches/cellar-2.3.x/config/src/main/java/org/apache/karaf/cellar/config/shell/ConfigCommandSupport.java
URL: http://svn.apache.org/viewvc/karaf/cellar/branches/cellar-2.3.x/config/src/main/java/org/apache/karaf/cellar/config/shell/ConfigCommandSupport.java?rev=1405743&r1=1405742&r2=1405743&view=diff
==============================================================================
--- karaf/cellar/branches/cellar-2.3.x/config/src/main/java/org/apache/karaf/cellar/config/shell/ConfigCommandSupport.java (original)
+++ karaf/cellar/branches/cellar-2.3.x/config/src/main/java/org/apache/karaf/cellar/config/shell/ConfigCommandSupport.java Mon Nov 5 10:56:03 2012
@@ -31,5 +31,4 @@ public abstract class ConfigCommandSuppo
return support.isAllowed(group, category, pid, type);
}
-
}
Modified: karaf/cellar/branches/cellar-2.3.x/config/src/main/java/org/apache/karaf/cellar/config/shell/DeleteCommand.java
URL: http://svn.apache.org/viewvc/karaf/cellar/branches/cellar-2.3.x/config/src/main/java/org/apache/karaf/cellar/config/shell/DeleteCommand.java?rev=1405743&r1=1405742&r2=1405743&view=diff
==============================================================================
--- karaf/cellar/branches/cellar-2.3.x/config/src/main/java/org/apache/karaf/cellar/config/shell/DeleteCommand.java (original)
+++ karaf/cellar/branches/cellar-2.3.x/config/src/main/java/org/apache/karaf/cellar/config/shell/DeleteCommand.java Mon Nov 5 10:56:03 2012
@@ -59,10 +59,10 @@ public class DeleteCommand extends Confi
return null;
}
- Map<String, Properties> configurationMap = clusterManager.getMap(Constants.CONFIGURATION_MAP + Configurations.SEPARATOR + groupName);
- if (configurationMap != null) {
+ Map<String, Properties> distributedConfigurations = clusterManager.getMap(Constants.CONFIGURATION_MAP + Configurations.SEPARATOR + groupName);
+ if (distributedConfigurations != null) {
// update the distributed map
- Properties properties = configurationMap.remove(pid);
+ Properties properties = distributedConfigurations.remove(pid);
// broadcast the cluster event
RemoteConfigurationEvent event = new RemoteConfigurationEvent(pid);
Modified: karaf/cellar/branches/cellar-2.3.x/config/src/main/java/org/apache/karaf/cellar/config/shell/ListCommand.java
URL: http://svn.apache.org/viewvc/karaf/cellar/branches/cellar-2.3.x/config/src/main/java/org/apache/karaf/cellar/config/shell/ListCommand.java?rev=1405743&r1=1405742&r2=1405743&view=diff
==============================================================================
--- karaf/cellar/branches/cellar-2.3.x/config/src/main/java/org/apache/karaf/cellar/config/shell/ListCommand.java (original)
+++ karaf/cellar/branches/cellar-2.3.x/config/src/main/java/org/apache/karaf/cellar/config/shell/ListCommand.java Mon Nov 5 10:56:03 2012
@@ -45,14 +45,14 @@ public class ListCommand extends ConfigC
return null;
}
- Map<String, Properties> configurationDistributedMap = clusterManager.getMap(Constants.CONFIGURATION_MAP + Configurations.SEPARATOR + groupName);
+ Map<String, Properties> distributedConfigurations = clusterManager.getMap(Constants.CONFIGURATION_MAP + Configurations.SEPARATOR + groupName);
- if (configurationDistributedMap != null && !configurationDistributedMap.isEmpty()) {
- for (String pid : configurationDistributedMap.keySet()) {
+ if (distributedConfigurations != null && !distributedConfigurations.isEmpty()) {
+ for (String pid : distributedConfigurations.keySet()) {
System.out.println("----------------------------------------------------------------");
System.out.println("Pid: " + pid);
if (!minimal) {
- Properties properties = configurationDistributedMap.get(pid);
+ Properties properties = distributedConfigurations.get(pid);
if (properties != null) {
System.out.println("Properties:");
for (Enumeration e = properties.keys(); e.hasMoreElements();) {
Modified: karaf/cellar/branches/cellar-2.3.x/config/src/main/java/org/apache/karaf/cellar/config/shell/PropAppendCommand.java
URL: http://svn.apache.org/viewvc/karaf/cellar/branches/cellar-2.3.x/config/src/main/java/org/apache/karaf/cellar/config/shell/PropAppendCommand.java?rev=1405743&r1=1405742&r2=1405743&view=diff
==============================================================================
--- karaf/cellar/branches/cellar-2.3.x/config/src/main/java/org/apache/karaf/cellar/config/shell/PropAppendCommand.java (original)
+++ karaf/cellar/branches/cellar-2.3.x/config/src/main/java/org/apache/karaf/cellar/config/shell/PropAppendCommand.java Mon Nov 5 10:56:03 2012
@@ -64,10 +64,10 @@ public class PropAppendCommand extends C
return null;
}
- Map<String, Properties> configurationMap = clusterManager.getMap(Constants.CONFIGURATION_MAP + Configurations.SEPARATOR + groupName);
- if (configurationMap != null) {
+ Map<String, Properties> distributedConfigurations = clusterManager.getMap(Constants.CONFIGURATION_MAP + Configurations.SEPARATOR + groupName);
+ if (distributedConfigurations != null) {
// update the distributed map
- Properties properties = configurationMap.get(pid);
+ Properties properties = distributedConfigurations.get(pid);
if (properties == null) {
properties = new Properties();
}
@@ -80,7 +80,7 @@ public class PropAppendCommand extends C
System.err.println("Append failed: current value is not a String");
return null;
}
- configurationMap.put(pid, properties);
+ distributedConfigurations.put(pid, properties);
// broadcast the cluster event
RemoteConfigurationEvent event = new RemoteConfigurationEvent(pid);
Modified: karaf/cellar/branches/cellar-2.3.x/config/src/main/java/org/apache/karaf/cellar/config/shell/PropListCommand.java
URL: http://svn.apache.org/viewvc/karaf/cellar/branches/cellar-2.3.x/config/src/main/java/org/apache/karaf/cellar/config/shell/PropListCommand.java?rev=1405743&r1=1405742&r2=1405743&view=diff
==============================================================================
--- karaf/cellar/branches/cellar-2.3.x/config/src/main/java/org/apache/karaf/cellar/config/shell/PropListCommand.java (original)
+++ karaf/cellar/branches/cellar-2.3.x/config/src/main/java/org/apache/karaf/cellar/config/shell/PropListCommand.java Mon Nov 5 10:56:03 2012
@@ -45,10 +45,10 @@ public class PropListCommand extends Cel
return null;
}
- Map<String, Properties> configurationMap = clusterManager.getMap(Constants.CONFIGURATION_MAP + Configurations.SEPARATOR + groupName);
+ Map<String, Properties> distributedConfigurations = clusterManager.getMap(Constants.CONFIGURATION_MAP + Configurations.SEPARATOR + groupName);
- if (configurationMap != null && !configurationMap.isEmpty()) {
- Properties properties = configurationMap.get(pid);
+ if (distributedConfigurations != null && !distributedConfigurations.isEmpty()) {
+ Properties properties = distributedConfigurations.get(pid);
if (properties == null || properties.isEmpty()) {
System.err.println("No configuration PID found for group " + groupName);
} else {
Modified: karaf/cellar/branches/cellar-2.3.x/config/src/main/java/org/apache/karaf/cellar/config/shell/PropSetCommand.java
URL: http://svn.apache.org/viewvc/karaf/cellar/branches/cellar-2.3.x/config/src/main/java/org/apache/karaf/cellar/config/shell/PropSetCommand.java?rev=1405743&r1=1405742&r2=1405743&view=diff
==============================================================================
--- karaf/cellar/branches/cellar-2.3.x/config/src/main/java/org/apache/karaf/cellar/config/shell/PropSetCommand.java (original)
+++ karaf/cellar/branches/cellar-2.3.x/config/src/main/java/org/apache/karaf/cellar/config/shell/PropSetCommand.java Mon Nov 5 10:56:03 2012
@@ -67,15 +67,15 @@ public class PropSetCommand extends Conf
return null;
}
- Map<String, Properties> configurationMap = clusterManager.getMap(Constants.CONFIGURATION_MAP + Configurations.SEPARATOR + groupName);
- if (configurationMap != null) {
- // update the distributed map
- Properties properties = configurationMap.get(pid);
+ Map<String, Properties> distributedConfigurations = clusterManager.getMap(Constants.CONFIGURATION_MAP + Configurations.SEPARATOR + groupName);
+ if (distributedConfigurations != null) {
+ // update the distributed configuration
+ Properties properties = distributedConfigurations.get(pid);
if (properties == null) {
properties = new Properties();
}
properties.put(key, value);
- configurationMap.put(pid, properties);
+ distributedConfigurations.put(pid, properties);
// broadcast the cluster event
RemoteConfigurationEvent event = new RemoteConfigurationEvent(pid);