[exo-jcr-commits] exo-jcr SVN: r5233 - in kernel/branches/2.2.x: patch/2.2.11-GA/KER-180 and 1 other directory.

do-not-reply at jboss.org do-not-reply at jboss.org
Wed Nov 23 07:32:33 EST 2011


Author: trang_vu
Date: 2011-11-23 07:32:33 -0500 (Wed, 23 Nov 2011)
New Revision: 5233

Added:
   kernel/branches/2.2.x/patch/2.2.11-GA/KER-180/readme.txt
Modified:
   kernel/branches/2.2.x/exo.kernel.container/src/main/java/org/exoplatform/container/PropertyConfigurator.java
   kernel/branches/2.2.x/exo.kernel.container/src/main/java/org/exoplatform/container/StandaloneContainer.java
Log:
KER-180: Propose a maven profile for each supported configuration

Fix description
* Add new method PropertyConfigurator to work with the StandaloneContainer.
  If the system property PropertyManager.PROPERTIES_URL has been set properly, it will load the properties from the file and load them as system properties.


Modified: kernel/branches/2.2.x/exo.kernel.container/src/main/java/org/exoplatform/container/PropertyConfigurator.java
===================================================================
--- kernel/branches/2.2.x/exo.kernel.container/src/main/java/org/exoplatform/container/PropertyConfigurator.java	2011-11-23 10:03:55 UTC (rev 5232)
+++ kernel/branches/2.2.x/exo.kernel.container/src/main/java/org/exoplatform/container/PropertyConfigurator.java	2011-11-23 12:32:33 UTC (rev 5233)
@@ -62,32 +62,38 @@
    /** The logger. */
    private final Log log = ExoLogger.getExoLogger(PropertyConfigurator.class);
 
+   public PropertyConfigurator(ConfigurationManager confManager)
+   {
+      this(null, confManager);
+   }
+
    public PropertyConfigurator(InitParams params, ConfigurationManager confManager)
    {
-      PropertiesParam propertiesParam = params.getPropertiesParam("properties");
-      if (propertiesParam != null)
+      String path = null;
+      if (params != null)
       {
-         log.debug("Going to initialize properties from init param");
-         for (Iterator<Property> i = propertiesParam.getPropertyIterator();i.hasNext();)
+         PropertiesParam propertiesParam = params.getPropertiesParam("properties");
+         if (propertiesParam != null)
          {
-            Property property = i.next();
-            String name = property.getName();
-            String value = property.getValue();
-            log.debug("Adding property from init param " + name + " = " + value);
-            PropertyManager.setProperty(name, value);
+            log.debug("Going to initialize properties from init param");
+            for (Iterator<Property> i = propertiesParam.getPropertyIterator();i.hasNext();)
+            {
+               Property property = i.next();
+               String name = property.getName();
+               String value = property.getValue();
+               log.debug("Adding property from init param " + name + " = " + value);
+               PropertyManager.setProperty(name, value);
+            }
+         }         
+         ValueParam pathParam = params.getValueParam("properties.url");
+         if (pathParam != null)
+         {
+            log.debug("Using file path " + path + " found from configuration");
+            path = pathParam.getValue();
          }
       }
 
       //
-      String path = null;
-      ValueParam pathParam = params.getValueParam("properties.url");
-      if (pathParam != null)
-      {
-         log.debug("Using file path " + path + " found from configuration");
-         path = pathParam.getValue();
-      }
-
-      //
       String systemPath = PropertyManager.getProperty(PropertyManager.PROPERTIES_URL);
       if (systemPath != null)
       {

Modified: kernel/branches/2.2.x/exo.kernel.container/src/main/java/org/exoplatform/container/StandaloneContainer.java
===================================================================
--- kernel/branches/2.2.x/exo.kernel.container/src/main/java/org/exoplatform/container/StandaloneContainer.java	2011-11-23 10:03:55 UTC (rev 5232)
+++ kernel/branches/2.2.x/exo.kernel.container/src/main/java/org/exoplatform/container/StandaloneContainer.java	2011-11-23 12:32:33 UTC (rev 5233)
@@ -82,6 +82,10 @@
       configurationManager = new ConfigurationManagerImpl(configClassLoader, ExoContainer.getProfiles());
       this.registerComponentInstance(ConfigurationManager.class, configurationManager);
       registerComponentImplementation(SessionManagerImpl.class);
+      // Workaround used to allow to use the PropertyConfigurator with the StandaloneContainer
+      // If the system property PropertyManager.PROPERTIES_URL has been set properly, it will load the properties
+      // from the file and load them as system properties
+      new PropertyConfigurator(configurationManager);
    }
 
    /**

Added: kernel/branches/2.2.x/patch/2.2.11-GA/KER-180/readme.txt
===================================================================
--- kernel/branches/2.2.x/patch/2.2.11-GA/KER-180/readme.txt	                        (rev 0)
+++ kernel/branches/2.2.x/patch/2.2.11-GA/KER-180/readme.txt	2011-11-23 12:32:33 UTC (rev 5233)
@@ -0,0 +1,67 @@
+Summary
+
+    * Status: Propose a maven profile for each supported configuration
+    * CCP Issue: N/A, Product Jira Issue: KER-180.
+    * Complexity: Low
+
+The Proposal
+Problem description
+
+What is the problem to fix?
+Changes for the kernel from issue JCR-1689.
+
+See base issue https://jira.exoplatform.org/browse/JCR-1689
+
+Fix description
+
+How is the problem fixed?
+  * Add new method PropertyConfigurator to work with the StandaloneContainer.
+    If the system property PropertyManager.PROPERTIES_URL has been set properly, it will load the properties from the file and load them as system properties.
+
+Patch file: KER-180.patch
+
+Tests to perform
+
+Reproduction test
+  * No
+
+Tests performed at DevLevel
+  * No
+
+Tests performed at QA/Support Level
+*
+
+Documentation changes
+
+Documentation changes:
+  * No
+
+Configuration changes
+
+Configuration changes:
+
+    * No
+
+Will previous configuration continue to work?
+
+* Yes 
+
+Risks and impacts
+
+Can this bug fix have any side effects on current client projects?
+
+    * No
+
+Is there a performance risk/cost?
+  * No
+
+Validation (PM/Support/QA)
+
+PM Comment
+*PM validated
+
+Support Comment
+*Validated by PM, on behalf of Support
+
+QA Feedbacks
+*



More information about the exo-jcr-commits mailing list