jackrabbit-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ju...@apache.org
Subject svn commit: r382213 - /incubator/jackrabbit/trunk/jackrabbit/src/main/java/org/apache/jackrabbit/core/TransientRepository.java
Date Thu, 02 Mar 2006 01:10:11 GMT
Author: jukka
Date: Wed Mar  1 17:10:09 2006
New Revision: 382213

URL: http://svn.apache.org/viewcvs?rev=382213&view=rev
Log:
JSR-328: Removed the TransientRepository(RepositoryConfig) constructor to avoid problems with
reusing the config instance.

Modified:
    incubator/jackrabbit/trunk/jackrabbit/src/main/java/org/apache/jackrabbit/core/TransientRepository.java

Modified: incubator/jackrabbit/trunk/jackrabbit/src/main/java/org/apache/jackrabbit/core/TransientRepository.java
URL: http://svn.apache.org/viewcvs/incubator/jackrabbit/trunk/jackrabbit/src/main/java/org/apache/jackrabbit/core/TransientRepository.java?rev=382213&r1=382212&r2=382213&view=diff
==============================================================================
--- incubator/jackrabbit/trunk/jackrabbit/src/main/java/org/apache/jackrabbit/core/TransientRepository.java
(original)
+++ incubator/jackrabbit/trunk/jackrabbit/src/main/java/org/apache/jackrabbit/core/TransientRepository.java
Wed Mar  1 17:10:09 2006
@@ -119,33 +119,27 @@
 
     /**
      * Creates a transient repository proxy that will use the given repository
-     * configuration to initialize the underlying repository instances.
-     * 
-     * @param config repository configuration
-     * @throws IOException if the static repository descriptors cannot be loaded
-     */
-    public TransientRepository(final RepositoryConfig config)
-            throws IOException {
-        this(new RepositoryFactory() {
-            public RepositoryImpl getRepository() throws RepositoryException {
-                return RepositoryImpl.create(config);
-            }
-        });
-    }
-
-    /**
-     * Creates a transient repository proxy that will use the given repository
      * configuration file and home directory paths to initialize the underlying
-     * repository instances.
+     * repository instances. The repository configuration file will be reloaded
+     * whenever 
      * 
      * @param config repository configuration file
      * @param home repository home directory
-     * @throws ConfigurationException if the configuration file is invalid
      * @throws IOException if the static repository descriptors cannot be loaded
      */
-    public TransientRepository(String config, String home)
+    public TransientRepository(final String config, final String home)
             throws ConfigurationException, IOException {
-        this(RepositoryConfig.create(config, home));
+        this(new RepositoryFactory() {
+            public RepositoryImpl getRepository() throws RepositoryException {
+                try {
+                    RepositoryConfig rc = RepositoryConfig.create(config, home);
+                    return RepositoryImpl.create(rc);
+                } catch (ConfigurationException e) {
+                    throw new RepositoryException(
+                            "Invalid repository configuration: " + config, e);
+                }
+            }
+        });
     }
 
     /**



Mime
View raw message