[exo-jcr-commits] exo-jcr SVN: r1346 - jcr/branches/1.12.0-OPT/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/config.

do-not-reply at jboss.org do-not-reply at jboss.org
Mon Jan 11 10:57:13 EST 2010


Author: pnedonosko
Date: 2010-01-11 10:57:12 -0500 (Mon, 11 Jan 2010)
New Revision: 1346

Modified:
   jcr/branches/1.12.0-OPT/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/config/RepositoryServiceConfigurationImpl.java
Log:
EXOJCR-381: repo service config cleanup

Modified: jcr/branches/1.12.0-OPT/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/config/RepositoryServiceConfigurationImpl.java
===================================================================
--- jcr/branches/1.12.0-OPT/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/config/RepositoryServiceConfigurationImpl.java	2010-01-11 15:42:29 UTC (rev 1345)
+++ jcr/branches/1.12.0-OPT/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/config/RepositoryServiceConfigurationImpl.java	2010-01-11 15:57:12 UTC (rev 1346)
@@ -62,9 +62,9 @@
    private ConfigurationManager configurationService;
 
    private ConfigurationPersister configurationPersister;
-   
-   private final List<String> configExtensionPaths = new CopyOnWriteArrayList<String>(); 
 
+   private final List<String> configExtensionPaths = new CopyOnWriteArrayList<String>();
+
    public RepositoryServiceConfigurationImpl(InitParams params, ConfigurationManager configurationService,
       InitialContextInitializer initialContextInitializer) throws RepositoryConfigurationException
    {
@@ -75,9 +75,10 @@
       {
          String cn = params.getPropertiesParam("working-conf").getProperty("persister-class-name");
          if (cn == null)
-            cn = params.getPropertiesParam("working-conf").getProperty("persisterClassName"); // try old
-         // name,
-         // pre 1.9
+         {
+            cn = params.getPropertiesParam("working-conf").getProperty("persisterClassName"); // try old name, pre 1.9
+         }
+
          if (cn != null)
          {
             try
@@ -116,7 +117,7 @@
    {
       configExtensionPaths.add(plugin.getConfPath());
    }
-   
+
    /*
     * (non-Javadoc)
     * @see org.exoplatform.services.jcr.config.RepositoryServiceConfiguration#isRetainable()
@@ -127,12 +128,12 @@
       {
          return true;
       }
+      
       String strfileUri = param.getValue();
       URL fileURL;
       try
       {
          fileURL = configurationService.getURL(strfileUri);
-
       }
       catch (Exception e)
       {
@@ -156,7 +157,7 @@
             throw new RepositoryException("Unsupported  configuration place "
                + configurationService.getURL(param.getValue())
                + " If you want to save configuration, start repository from standalone file."
-               + " Or persisterClassName not configured");
+               + " Or persister-class-name not configured");
 
          OutputStream saveStream = null;
 
@@ -184,6 +185,7 @@
          // writing configuration in to the persister
          if (configurationPersister != null)
          {
+            // TODO file output stream
             configurationPersister.write(new ByteArrayInputStream(((ByteArrayOutputStream)saveStream).toByteArray()));
          }
 
@@ -210,7 +212,7 @@
       }
 
    }
-   
+
    private void initFromStream(InputStream jcrConfigurationInputStream) throws RepositoryConfigurationException
    {
       try
@@ -237,9 +239,9 @@
          catch (IOException e)
          {
             // ignore me
-         }                     
+         }
       }
-      
+
    }
 
    /**
@@ -251,18 +253,18 @@
       {
          if (configExtensionPaths.isEmpty())
          {
-            initFromStream(configurationService.getInputStream(param.getValue()));            
+            initFromStream(configurationService.getInputStream(param.getValue()));
          }
          else
          {
-            
-            String[] paths = (String[]) configExtensionPaths.toArray(new String[configExtensionPaths.size()]);
-            for (int i = paths.length - 1 ; i >= 0 ; i--)
+
+            String[] paths = (String[])configExtensionPaths.toArray(new String[configExtensionPaths.size()]);
+            for (int i = paths.length - 1; i >= 0; i--)
             {
                // 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]));                  
+                  init(configurationService.getInputStream(paths[i]));
                }
                else
                {



More information about the exo-jcr-commits mailing list