incubator-sling-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cziege...@apache.org
Subject svn commit: r1222174 - in /sling/trunk/installer/factories/configuration/src/main/java/org/apache/sling/installer/factories/configuration/impl: AbstractConfigTask.java ConfigUtil.java
Date Thu, 22 Dec 2011 10:52:58 GMT
Author: cziegeler
Date: Thu Dec 22 10:52:58 2011
New Revision: 1222174

URL: http://svn.apache.org/viewvc?rev=1222174&view=rev
Log:
SLING-2342 : Support old factory configurations

Modified:
    sling/trunk/installer/factories/configuration/src/main/java/org/apache/sling/installer/factories/configuration/impl/AbstractConfigTask.java
    sling/trunk/installer/factories/configuration/src/main/java/org/apache/sling/installer/factories/configuration/impl/ConfigUtil.java

Modified: sling/trunk/installer/factories/configuration/src/main/java/org/apache/sling/installer/factories/configuration/impl/AbstractConfigTask.java
URL: http://svn.apache.org/viewvc/sling/trunk/installer/factories/configuration/src/main/java/org/apache/sling/installer/factories/configuration/impl/AbstractConfigTask.java?rev=1222174&r1=1222173&r2=1222174&view=diff
==============================================================================
--- sling/trunk/installer/factories/configuration/src/main/java/org/apache/sling/installer/factories/configuration/impl/AbstractConfigTask.java
(original)
+++ sling/trunk/installer/factories/configuration/src/main/java/org/apache/sling/installer/factories/configuration/impl/AbstractConfigTask.java
Thu Dec 22 10:52:58 2011
@@ -90,6 +90,6 @@ abstract class AbstractConfigTask extend
     protected Configuration getConfiguration(final ConfigurationAdmin ca,
                                              final boolean createIfNeeded)
     throws IOException, InvalidSyntaxException {
-        return ConfigUtil.getConfiguration(ca, this.factoryPid, (this.factoryPid != null
? this.aliasPid : this.configPid), createIfNeeded);
+        return ConfigUtil.getConfiguration(ca, this.factoryPid, (this.factoryPid != null
&& this.aliasPid != null ? this.aliasPid : this.configPid), createIfNeeded);
     }
 }

Modified: sling/trunk/installer/factories/configuration/src/main/java/org/apache/sling/installer/factories/configuration/impl/ConfigUtil.java
URL: http://svn.apache.org/viewvc/sling/trunk/installer/factories/configuration/src/main/java/org/apache/sling/installer/factories/configuration/impl/ConfigUtil.java?rev=1222174&r1=1222173&r2=1222174&view=diff
==============================================================================
--- sling/trunk/installer/factories/configuration/src/main/java/org/apache/sling/installer/factories/configuration/impl/ConfigUtil.java
(original)
+++ sling/trunk/installer/factories/configuration/src/main/java/org/apache/sling/installer/factories/configuration/impl/ConfigUtil.java
Thu Dec 22 10:52:58 2011
@@ -147,8 +147,18 @@ abstract class ConfigUtil {
                         + "))");
             }
             if (configs == null || configs.length == 0) {
-                if (createIfNeeded) {
-                    result = ca.createFactoryConfiguration(factoryPid, null);
+                // check for old style with alias pid
+                configs = ca.listConfigurations(
+                        "(&(" + ConfigurationAdmin.SERVICE_FACTORYPID
+                        + "=" + factoryPid + ")(" + ALIAS_KEY + "=" + configPid
+                        + "))");
+
+                if (configs == null || configs.length == 0) {
+                    if (createIfNeeded) {
+                        result = ca.createFactoryConfiguration(factoryPid, null);
+                    }
+                } else {
+                    result = configs[0];
                 }
             } else {
                 result = configs[0];



Mime
View raw message