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 2013/01/14 21:06:58 UTC
svn commit: r1433087 - in /karaf/cellar/branches/cellar-2.3.x: ./
core/src/main/java/org/apache/karaf/cellar/core/
core/src/main/java/org/apache/karaf/cellar/core/control/
core/src/test/java/org/apache/karaf/cellar/core/
hazelcast/src/main/java/org/apa...
Author: jbonofre
Date: Mon Jan 14 20:06:58 2013
New Revision: 1433087
URL: http://svn.apache.org/viewvc?rev=1433087&view=rev
Log:
[KARAF-1981] Upgrade to Felix ConfigAdmin 1.6.0
Modified:
karaf/cellar/branches/cellar-2.3.x/core/src/main/java/org/apache/karaf/cellar/core/CellarSupport.java
karaf/cellar/branches/cellar-2.3.x/core/src/main/java/org/apache/karaf/cellar/core/control/ConsumerSwitchCommandHandler.java
karaf/cellar/branches/cellar-2.3.x/core/src/main/java/org/apache/karaf/cellar/core/control/ManageHandlersCommandHandler.java
karaf/cellar/branches/cellar-2.3.x/core/src/main/java/org/apache/karaf/cellar/core/control/ProducerSwitchCommandHandler.java
karaf/cellar/branches/cellar-2.3.x/core/src/test/java/org/apache/karaf/cellar/core/CellarSupportTest.java
karaf/cellar/branches/cellar-2.3.x/hazelcast/src/main/java/org/apache/karaf/cellar/hazelcast/HazelcastGroupManager.java
karaf/cellar/branches/cellar-2.3.x/obr/src/main/java/org/apache/karaf/cellar/obr/ObrUrlSynchronizer.java
karaf/cellar/branches/cellar-2.3.x/pom.xml
Modified: karaf/cellar/branches/cellar-2.3.x/core/src/main/java/org/apache/karaf/cellar/core/CellarSupport.java
URL: http://svn.apache.org/viewvc/karaf/cellar/branches/cellar-2.3.x/core/src/main/java/org/apache/karaf/cellar/core/CellarSupport.java?rev=1433087&r1=1433086&r2=1433087&view=diff
==============================================================================
--- karaf/cellar/branches/cellar-2.3.x/core/src/main/java/org/apache/karaf/cellar/core/CellarSupport.java (original)
+++ karaf/cellar/branches/cellar-2.3.x/core/src/main/java/org/apache/karaf/cellar/core/CellarSupport.java Mon Jan 14 20:06:58 2013
@@ -51,15 +51,15 @@ public class CellarSupport {
if (group != null) {
try {
Configuration configuration = configurationAdmin.getConfiguration(Configurations.GROUP);
- Dictionary<String, String> dictionary = configuration.getProperties();
+ Dictionary<String, Object> dictionary = configuration.getProperties();
if (dictionary != null) {
- String parent = dictionary.get(group + Configurations.SEPARATOR + Configurations.PARENT);
+ String parent = (String) dictionary.get(group + Configurations.SEPARATOR + Configurations.PARENT);
if (parent != null) {
result = getListEntries(listType, parent, category, type);
}
String propertyName = group + Configurations.SEPARATOR + category + Configurations.SEPARATOR + listType + Configurations.SEPARATOR + type.name().toLowerCase();
- String propertyValue = dictionary.get(propertyName);
+ String propertyValue = (String) dictionary.get(propertyName);
if (propertyValue != null) {
propertyValue = propertyValue.replaceAll("\n","");
String[] itemList = propertyValue.split(Configurations.DELIMETER);
Modified: karaf/cellar/branches/cellar-2.3.x/core/src/main/java/org/apache/karaf/cellar/core/control/ConsumerSwitchCommandHandler.java
URL: http://svn.apache.org/viewvc/karaf/cellar/branches/cellar-2.3.x/core/src/main/java/org/apache/karaf/cellar/core/control/ConsumerSwitchCommandHandler.java?rev=1433087&r1=1433086&r2=1433087&view=diff
==============================================================================
--- karaf/cellar/branches/cellar-2.3.x/core/src/main/java/org/apache/karaf/cellar/core/control/ConsumerSwitchCommandHandler.java (original)
+++ karaf/cellar/branches/cellar-2.3.x/core/src/main/java/org/apache/karaf/cellar/core/control/ConsumerSwitchCommandHandler.java Mon Jan 14 20:06:58 2013
@@ -65,7 +65,7 @@ public class ConsumerSwitchCommandHandle
try {
Configuration configuration = configurationAdmin.getConfiguration(Configurations.NODE);
if (configuration != null) {
- Dictionary<String, String> properties = configuration.getProperties();
+ Dictionary<String, Object> properties = configuration.getProperties();
if (properties != null) {
properties.put(Configurations.CONSUMER, switchStatus.getValue().toString());
configuration.update(properties);
Modified: karaf/cellar/branches/cellar-2.3.x/core/src/main/java/org/apache/karaf/cellar/core/control/ManageHandlersCommandHandler.java
URL: http://svn.apache.org/viewvc/karaf/cellar/branches/cellar-2.3.x/core/src/main/java/org/apache/karaf/cellar/core/control/ManageHandlersCommandHandler.java?rev=1433087&r1=1433086&r2=1433087&view=diff
==============================================================================
--- karaf/cellar/branches/cellar-2.3.x/core/src/main/java/org/apache/karaf/cellar/core/control/ManageHandlersCommandHandler.java (original)
+++ karaf/cellar/branches/cellar-2.3.x/core/src/main/java/org/apache/karaf/cellar/core/control/ManageHandlersCommandHandler.java Mon Jan 14 20:06:58 2013
@@ -103,7 +103,7 @@ public class ManageHandlersCommandHandle
try {
Configuration configuration = configurationAdmin.getConfiguration(Configurations.NODE);
if (configuration != null) {
- Dictionary<String, String> properties = configuration.getProperties();
+ Dictionary<String, Object> properties = configuration.getProperties();
if (properties != null) {
properties.put(Configurations.HANDLER + "." + handler, switchStatus.getValue().toString());
configuration.update(properties);
Modified: karaf/cellar/branches/cellar-2.3.x/core/src/main/java/org/apache/karaf/cellar/core/control/ProducerSwitchCommandHandler.java
URL: http://svn.apache.org/viewvc/karaf/cellar/branches/cellar-2.3.x/core/src/main/java/org/apache/karaf/cellar/core/control/ProducerSwitchCommandHandler.java?rev=1433087&r1=1433086&r2=1433087&view=diff
==============================================================================
--- karaf/cellar/branches/cellar-2.3.x/core/src/main/java/org/apache/karaf/cellar/core/control/ProducerSwitchCommandHandler.java (original)
+++ karaf/cellar/branches/cellar-2.3.x/core/src/main/java/org/apache/karaf/cellar/core/control/ProducerSwitchCommandHandler.java Mon Jan 14 20:06:58 2013
@@ -64,7 +64,7 @@ public class ProducerSwitchCommandHandle
try {
Configuration configuration = configurationAdmin.getConfiguration(Configurations.NODE);
if (configuration != null) {
- Dictionary<String, String> properties = configuration.getProperties();
+ Dictionary<String, Object> properties = configuration.getProperties();
if (properties != null) {
properties.put(Configurations.PRODUCER, switchStatus.getValue().toString());
configuration.update(properties);
Modified: karaf/cellar/branches/cellar-2.3.x/core/src/test/java/org/apache/karaf/cellar/core/CellarSupportTest.java
URL: http://svn.apache.org/viewvc/karaf/cellar/branches/cellar-2.3.x/core/src/test/java/org/apache/karaf/cellar/core/CellarSupportTest.java?rev=1433087&r1=1433086&r2=1433087&view=diff
==============================================================================
--- karaf/cellar/branches/cellar-2.3.x/core/src/test/java/org/apache/karaf/cellar/core/CellarSupportTest.java (original)
+++ karaf/cellar/branches/cellar-2.3.x/core/src/test/java/org/apache/karaf/cellar/core/CellarSupportTest.java Mon Jan 14 20:06:58 2013
@@ -14,6 +14,7 @@
package org.apache.karaf.cellar.core;
import java.io.InputStream;
+import java.util.Dictionary;
import java.util.Properties;
import org.apache.karaf.cellar.core.event.EventType;
import org.easymock.EasyMock;
@@ -44,7 +45,8 @@ public class CellarSupportTest {
props.load(is);
is.close();
expect(configurationAdmin.getConfiguration(EasyMock.<String>anyObject())).andReturn(configuration).anyTimes();
- expect(configuration.getProperties()).andReturn(props).anyTimes();
+ Dictionary propsDictionary = (Dictionary) props;
+ expect(configuration.getProperties()).andReturn(propsDictionary).anyTimes();
replay(configuration);
replay(configurationAdmin);
}
Modified: karaf/cellar/branches/cellar-2.3.x/hazelcast/src/main/java/org/apache/karaf/cellar/hazelcast/HazelcastGroupManager.java
URL: http://svn.apache.org/viewvc/karaf/cellar/branches/cellar-2.3.x/hazelcast/src/main/java/org/apache/karaf/cellar/hazelcast/HazelcastGroupManager.java?rev=1433087&r1=1433086&r2=1433087&view=diff
==============================================================================
--- karaf/cellar/branches/cellar-2.3.x/hazelcast/src/main/java/org/apache/karaf/cellar/hazelcast/HazelcastGroupManager.java (original)
+++ karaf/cellar/branches/cellar-2.3.x/hazelcast/src/main/java/org/apache/karaf/cellar/hazelcast/HazelcastGroupManager.java Mon Jan 14 20:06:58 2013
@@ -76,11 +76,11 @@ public class HazelcastGroupManager imple
// create group stored in configuration admin
Configuration configuration = configurationAdmin.getConfiguration(Configurations.GROUP);
if (configuration != null) {
- Dictionary<String, String> properties = configuration.getProperties();
+ Dictionary<String, Object> properties = configuration.getProperties();
if (properties == null) {
- properties = new Hashtable<String, String>();
+ properties = new Hashtable<String, Object>();
}
- String groups = properties.get(Configurations.GROUPS_KEY);
+ String groups = (String) properties.get(Configurations.GROUPS_KEY);
Set<String> groupNames = convertStringToSet(groups);
if (groupNames != null && !groupNames.isEmpty()) {
for (String groupName : groupNames) {
@@ -95,11 +95,11 @@ public class HazelcastGroupManager imple
// add group membership from configuration
Configuration configuration = configurationAdmin.getConfiguration(Configurations.NODE);
if (configuration != null) {
- Dictionary<String, String> properties = configuration.getProperties();
+ Dictionary<String, Object> properties = configuration.getProperties();
if (properties == null) {
- properties = new Hashtable<String, String>();
+ properties = new Hashtable<String, Object>();
}
- String groups = properties.get(Configurations.GROUPS_KEY);
+ String groups = (String) properties.get(Configurations.GROUPS_KEY);
Set<String> groupNames = convertStringToSet(groups);
if (groupNames != null && !groupNames.isEmpty()) {
for (String groupName : groupNames) {
@@ -186,9 +186,9 @@ public class HazelcastGroupManager imple
private void persist(Map<String, Group> groups) throws Exception {
Configuration configuration = configurationAdmin.getConfiguration(Configurations.GROUP);
if (configuration != null) {
- Dictionary<String, String> properties = configuration.getProperties();
+ Dictionary<String, Object> properties = configuration.getProperties();
if (properties == null) {
- properties = new Hashtable<String, String>();
+ properties = new Hashtable<String, Object>();
}
properties.put(Configurations.GROUPS_KEY, convertSetToString(groups.keySet()));
configuration.update(properties);
@@ -334,8 +334,8 @@ public class HazelcastGroupManager imple
//Add group to configuration
try {
Configuration configuration = configurationAdmin.getConfiguration(Configurations.NODE);
- Dictionary<String, String> properties = configuration.getProperties();
- String groups = properties.get(Configurations.GROUPS_KEY);
+ Dictionary<String, Object> properties = configuration.getProperties();
+ String groups = (String) properties.get(Configurations.GROUPS_KEY);
if (groups == null || (groups.trim().length() < 1)) {
groups = groupName;
} else {
@@ -421,8 +421,8 @@ public class HazelcastGroupManager imple
//Remove group from configuration
try {
Configuration configuration = configurationAdmin.getConfiguration(Configurations.NODE);
- Dictionary<String, String> properties = configuration.getProperties();
- String groups = properties.get(Configurations.GROUPS_KEY);
+ Dictionary<String, Object> properties = configuration.getProperties();
+ String groups = (String) properties.get(Configurations.GROUPS_KEY);
if (groups == null || (groups.trim().length() < 1)) {
groups = "";
} else if (groups.contains(groupName)) {
Modified: karaf/cellar/branches/cellar-2.3.x/obr/src/main/java/org/apache/karaf/cellar/obr/ObrUrlSynchronizer.java
URL: http://svn.apache.org/viewvc/karaf/cellar/branches/cellar-2.3.x/obr/src/main/java/org/apache/karaf/cellar/obr/ObrUrlSynchronizer.java?rev=1433087&r1=1433086&r2=1433087&view=diff
==============================================================================
--- karaf/cellar/branches/cellar-2.3.x/obr/src/main/java/org/apache/karaf/cellar/obr/ObrUrlSynchronizer.java (original)
+++ karaf/cellar/branches/cellar-2.3.x/obr/src/main/java/org/apache/karaf/cellar/obr/ObrUrlSynchronizer.java Mon Jan 14 20:06:58 2013
@@ -123,9 +123,9 @@ public class ObrUrlSynchronizer extends
try {
Configuration configuration = configurationAdmin.getConfiguration(Configurations.GROUP);
- Dictionary<String, String> properties = configuration.getProperties();
+ Dictionary<String, Object> properties = configuration.getProperties();
String propertyKey = groupName + Configurations.SEPARATOR + Constants.URLS_CONFIG_CATEGORY + Configurations.SEPARATOR + Configurations.SYNC;
- String propertyValue = properties.get(propertyKey);
+ String propertyValue = (String) properties.get(propertyKey);
result = Boolean.parseBoolean(propertyValue);
} catch (IOException e) {
LOGGER.error("CELLAR OBR: error while checking if sync is enabled", e);
Modified: karaf/cellar/branches/cellar-2.3.x/pom.xml
URL: http://svn.apache.org/viewvc/karaf/cellar/branches/cellar-2.3.x/pom.xml?rev=1433087&r1=1433086&r2=1433087&view=diff
==============================================================================
--- karaf/cellar/branches/cellar-2.3.x/pom.xml (original)
+++ karaf/cellar/branches/cellar-2.3.x/pom.xml Mon Jan 14 20:06:58 2013
@@ -37,7 +37,7 @@
<properties>
<easymock.version>3.1</easymock.version>
<felix.bundlerepository.version>1.6.6</felix.bundlerepository.version>
- <felix.configadmin.version>1.2.8</felix.configadmin.version>
+ <felix.configadmin.version>1.6.0</felix.configadmin.version>
<felix.webconsole.version>3.1.8</felix.webconsole.version>
<hazelcast.version>1.9.4.8</hazelcast.version>
<jclouds.version>1.3.2</jclouds.version>