Author: tolusha
Date: 2011-03-25 06:18:03 -0400 (Fri, 25 Mar 2011)
New Revision: 4174
Modified:
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/config/RepositoryServiceConfigurationImpl.java
Log:
EXOJCR-1233: we start first with the config with the biggest priority to the lowest.
So it will be first extensions, then normal config and then config from DB
Modified:
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/config/RepositoryServiceConfigurationImpl.java
===================================================================
---
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/config/RepositoryServiceConfigurationImpl.java 2011-03-25
08:50:43 UTC (rev 4173)
+++
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/config/RepositoryServiceConfigurationImpl.java 2011-03-25
10:18:03 UTC (rev 4174)
@@ -283,33 +283,42 @@
{
try
{
- if (configurationPersister != null &&
configurationPersister.hasConfig())
+ // Start from extensions first
+ String[] paths = configExtensionPaths.toArray(new
String[configExtensionPaths.size()]);
+ for (int i = paths.length - 1; i >= 0; i--)
{
- init(configurationPersister.read());
- merge(configurationService.getInputStream(param.getValue()));
+ // We start from the last one because as it is the one with highest priority
+ if (i == paths.length - 1)
+ {
+ init(configurationService.getInputStream(paths[i]));
+ }
+ else
+ {
+ merge(configurationService.getInputStream(paths[i]));
+ }
}
- else
+
+ // Then from normal config
+ if (configExtensionPaths.isEmpty())
{
init(configurationService.getInputStream(param.getValue()));
}
+ else
+ {
+ merge(configurationService.getInputStream(param.getValue()));
+ }
- // Will be merged extension repository configuration
- if (!configExtensionPaths.isEmpty())
+ // Then from config from persister
+ if (configurationPersister != null)
{
- // We start from the last one because as it is the one with highest priority
- String[] paths = configExtensionPaths.toArray(new
String[configExtensionPaths.size()]);
- for (int i = paths.length - 1; i >= 0; i--)
+ if (configurationPersister.hasConfig())
{
- merge(configurationService.getInputStream(paths[i]));
+ merge(configurationPersister.read());
}
- }
- // Store the merged configuration
- if (configurationPersister != null)
- {
+ // Store the merged configuration
retain();
}
-
}
catch (RepositoryConfigurationException e)
{
Show replies by date