[exo-jcr-commits] exo-jcr SVN: r5181 - kernel/trunk/exo.kernel.container/src/main/java/org/exoplatform/container.
do-not-reply at jboss.org
do-not-reply at jboss.org
Fri Nov 11 16:12:47 EST 2011
Author: nfilotto
Date: 2011-11-11 16:12:47 -0500 (Fri, 11 Nov 2011)
New Revision: 5181
Modified:
kernel/trunk/exo.kernel.container/src/main/java/org/exoplatform/container/PropertyConfigurator.java
kernel/trunk/exo.kernel.container/src/main/java/org/exoplatform/container/StandaloneContainer.java
Log:
EXOJCR-1624: Propose a maven profile for each supported configuration
* All changing values have been moved into properties files
* Configuration files for each db have been removed
* A new variable has been added in order to enable the statistics easily
* We have now one profile per driver instead of per db type
* Some changes have been applied at kernel level to be able to use the PropertyConfigurator with the StandaloneContainer
Modified: kernel/trunk/exo.kernel.container/src/main/java/org/exoplatform/container/PropertyConfigurator.java
===================================================================
--- kernel/trunk/exo.kernel.container/src/main/java/org/exoplatform/container/PropertyConfigurator.java 2011-11-11 14:15:14 UTC (rev 5180)
+++ kernel/trunk/exo.kernel.container/src/main/java/org/exoplatform/container/PropertyConfigurator.java 2011-11-11 21:12:47 UTC (rev 5181)
@@ -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/trunk/exo.kernel.container/src/main/java/org/exoplatform/container/StandaloneContainer.java
===================================================================
--- kernel/trunk/exo.kernel.container/src/main/java/org/exoplatform/container/StandaloneContainer.java 2011-11-11 14:15:14 UTC (rev 5180)
+++ kernel/trunk/exo.kernel.container/src/main/java/org/exoplatform/container/StandaloneContainer.java 2011-11-11 21:12:47 UTC (rev 5181)
@@ -96,6 +96,10 @@
{
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);
return null;
}
});
More information about the exo-jcr-commits
mailing list