karaf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ff...@apache.org
Subject svn commit: r1421678 - /karaf/branches/karaf-2.3.x/main/src/main/java/org/apache/karaf/main/Main.java
Date Fri, 14 Dec 2012 05:59:42 GMT
Author: ffang
Date: Fri Dec 14 05:59:41 2012
New Revision: 1421678

URL: http://svn.apache.org/viewvc?rev=1421678&view=rev
Log:
[KARAF-2058]ensure find the root instance entry when update root karaf instance name in instances.properties

Modified:
    karaf/branches/karaf-2.3.x/main/src/main/java/org/apache/karaf/main/Main.java

Modified: karaf/branches/karaf-2.3.x/main/src/main/java/org/apache/karaf/main/Main.java
URL: http://svn.apache.org/viewvc/karaf/branches/karaf-2.3.x/main/src/main/java/org/apache/karaf/main/Main.java?rev=1421678&r1=1421677&r2=1421678&view=diff
==============================================================================
--- karaf/branches/karaf-2.3.x/main/src/main/java/org/apache/karaf/main/Main.java (original)
+++ karaf/branches/karaf-2.3.x/main/src/main/java/org/apache/karaf/main/Main.java Fri Dec
14 05:59:41 2012
@@ -574,9 +574,15 @@ public class Main {
                     int count = Integer.parseInt(props.getProperty("count"));
 
                     // update root name if karaf.name got updated since the last container
start
-                    String savedRootName = props.getProperty("item.0.name");
-                    if (savedRootName != null && isRoot && !savedRootName.equals(instanceName))
{
-                        props.setProperty("item.0.name", instanceName);
+                    if (isRoot) {
+                        for (int i = 0; i < count; i++) {
+                            //looking for root instance entry
+                            String name = props.getProperty("item." + i + ".name");
+                            boolean root = Boolean.parseBoolean(props.getProperty("item."
+ i + ".root", "false"));
+                            if (root && !name.equals(instanceName)) {
+                                props.setProperty("item." + i + ".name", instanceName);
+                            }
+                        }
                     }
 
                     for (int i = 0; i < count; i++) {



Mime
View raw message