You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@jackrabbit.apache.org by st...@apache.org on 2006/03/15 15:19:37 UTC

svn commit: r386078 - in /incubator/jackrabbit/trunk/jackrabbit/src: main/java/org/apache/jackrabbit/core/ main/java/org/apache/jackrabbit/core/config/ main/java/org/apache/jackrabbit/core/version/ test/java/org/apache/jackrabbit/core/config/

Author: stefan
Date: Wed Mar 15 06:19:24 2006
New Revision: 386078

URL: http://svn.apache.org/viewcvs?rev=386078&view=rev
Log:
JCR-331: RepositoryConfig instance can not be reused once it has been passed to RepositoryImpl constructor

committing patch

Modified:
    incubator/jackrabbit/trunk/jackrabbit/src/main/java/org/apache/jackrabbit/core/RepositoryImpl.java
    incubator/jackrabbit/trunk/jackrabbit/src/main/java/org/apache/jackrabbit/core/SearchManager.java
    incubator/jackrabbit/trunk/jackrabbit/src/main/java/org/apache/jackrabbit/core/SessionImpl.java
    incubator/jackrabbit/trunk/jackrabbit/src/main/java/org/apache/jackrabbit/core/config/FileSystemConfig.java
    incubator/jackrabbit/trunk/jackrabbit/src/main/java/org/apache/jackrabbit/core/config/RepositoryConfig.java
    incubator/jackrabbit/trunk/jackrabbit/src/main/java/org/apache/jackrabbit/core/config/SearchConfig.java
    incubator/jackrabbit/trunk/jackrabbit/src/main/java/org/apache/jackrabbit/core/config/VersioningConfig.java
    incubator/jackrabbit/trunk/jackrabbit/src/main/java/org/apache/jackrabbit/core/config/WorkspaceConfig.java
    incubator/jackrabbit/trunk/jackrabbit/src/main/java/org/apache/jackrabbit/core/version/VersionManagerImpl.java
    incubator/jackrabbit/trunk/jackrabbit/src/test/java/org/apache/jackrabbit/core/config/WorkspaceConfigTest.java

Modified: incubator/jackrabbit/trunk/jackrabbit/src/main/java/org/apache/jackrabbit/core/RepositoryImpl.java
URL: http://svn.apache.org/viewcvs/incubator/jackrabbit/trunk/jackrabbit/src/main/java/org/apache/jackrabbit/core/RepositoryImpl.java?rev=386078&r1=386077&r2=386078&view=diff
==============================================================================
--- incubator/jackrabbit/trunk/jackrabbit/src/main/java/org/apache/jackrabbit/core/RepositoryImpl.java (original)
+++ incubator/jackrabbit/trunk/jackrabbit/src/main/java/org/apache/jackrabbit/core/RepositoryImpl.java Wed Mar 15 06:19:24 2006
@@ -112,7 +112,7 @@
     public static final NodeId NODETYPES_NODE_ID = NodeId.valueOf("deadbeef-cafe-cafe-cafe-babecafebabe");
 
     /**
-     * the name of the filesystem resource containing the properties of the
+     * the name of the file system resource containing the properties of the
      * repository.
      */
     private static final String PROPERTIES_RESOURCE = "rep.properties";
@@ -142,7 +142,7 @@
     // configuration of the repository
     protected final RepositoryConfig repConfig;
 
-    // the master filesystem
+    // the virtual repository file system
     private final FileSystem repStore;
 
     // sub file system where the repository stores meta data such as uuid of root node, etc.
@@ -198,7 +198,7 @@
         acquireRepositoryLock() ;
 
         // setup file systems
-        repStore = repConfig.getFileSystem();
+        repStore = repConfig.getFileSystemConfig().createFileSystem();
         String fsRootPath = "/meta";
         try {
             if (!repStore.exists(fsRootPath) || !repStore.isFolder(fsRootPath)) {
@@ -280,13 +280,14 @@
     protected VersionManager createVersionManager(VersioningConfig vConfig,
                                                   DelegatingObservationDispatcher delegatingDispatcher)
             throws RepositoryException {
+        FileSystem fs = vConfig.getFileSystemConfig().createFileSystem();
         PersistenceManager pm = createPersistenceManager(vConfig.getHomeDir(),
-                vConfig.getFileSystem(),
+                fs,
                 vConfig.getPersistenceManagerConfig(),
                 rootNodeId,
                 nsReg,
                 ntReg);
-        return new VersionManagerImpl(pm, ntReg, delegatingDispatcher,
+        return new VersionManagerImpl(pm, fs, ntReg, delegatingDispatcher,
                 VERSION_STORAGE_NODE_ID, SYSTEM_ROOT_NODE_ID);
     }
 
@@ -874,14 +875,7 @@
             // close repository file system
             repStore.close();
         } catch (FileSystemException e) {
-            log.error("error while closing repository filesystem", e);
-        }
-
-        try {
-            // close versioning file system
-            repConfig.getVersioningConfig().getFileSystem().close();
-        } catch (FileSystemException e) {
-            log.error("error while closing versioning filesystem", e);
+            log.error("error while closing repository file system", e);
         }
 
         // make sure this instance is not used anymore
@@ -907,6 +901,14 @@
     }
 
     /**
+     * Returns the repository file system.
+     * @return repository file system
+     */
+    protected FileSystem getFileSystem() {
+        return repStore;
+    }
+
+    /**
      * Sets the default properties of the repository.
      * <p/>
      * This method loads the <code>Properties</code> from the
@@ -1505,8 +1507,7 @@
             log.info("initializing workspace '" + getName() + "'...");
 
             FileSystemConfig fsConfig = config.getFileSystemConfig();
-            fsConfig.init();
-            fs = fsConfig.getFileSystem();
+            fs = fsConfig.createFileSystem();
 
             persistMgr = createPersistenceManager(new File(config.getHomeDir()),
                     fs,
@@ -1587,8 +1588,12 @@
             }
 
             // close workspace file system
-            FileSystemConfig fsConfig = config.getFileSystemConfig();
-            fsConfig.dispose();
+            try {
+                fs.close();
+            } catch (FileSystemException fse) {
+                log.error("error while closing file system of workspace "
+                        + config.getName(), fse);
+            }
             fs = null;
 
             // reset idle timestamp

Modified: incubator/jackrabbit/trunk/jackrabbit/src/main/java/org/apache/jackrabbit/core/SearchManager.java
URL: http://svn.apache.org/viewcvs/incubator/jackrabbit/trunk/jackrabbit/src/main/java/org/apache/jackrabbit/core/SearchManager.java?rev=386078&r1=386077&r2=386078&view=diff
==============================================================================
--- incubator/jackrabbit/trunk/jackrabbit/src/main/java/org/apache/jackrabbit/core/SearchManager.java (original)
+++ incubator/jackrabbit/trunk/jackrabbit/src/main/java/org/apache/jackrabbit/core/SearchManager.java Wed Mar 15 06:19:24 2006
@@ -217,7 +217,11 @@
                          NodeId rootNodeId,
                          SearchManager parentMgr,
                          NodeId excludedNodeId) throws RepositoryException {
-        this.fs = config.getFileSystem();
+        if (config.getFileSystemConfig() != null) {
+            fs = config.getFileSystemConfig().createFileSystem();
+        } else {
+            fs = null;
+        }
         this.config = config;
         this.ntReg = ntReg;
         this.itemMgr = itemMgr;

Modified: incubator/jackrabbit/trunk/jackrabbit/src/main/java/org/apache/jackrabbit/core/SessionImpl.java
URL: http://svn.apache.org/viewcvs/incubator/jackrabbit/trunk/jackrabbit/src/main/java/org/apache/jackrabbit/core/SessionImpl.java?rev=386078&r1=386077&r2=386078&view=diff
==============================================================================
--- incubator/jackrabbit/trunk/jackrabbit/src/main/java/org/apache/jackrabbit/core/SessionImpl.java (original)
+++ incubator/jackrabbit/trunk/jackrabbit/src/main/java/org/apache/jackrabbit/core/SessionImpl.java Wed Mar 15 06:19:24 2006
@@ -310,7 +310,7 @@
         AccessManagerConfig amConfig = rep.getConfig().getAccessManagerConfig();
         try {
             AMContext ctx = new AMContext(new File(rep.getConfig().getHomeDir()),
-                    rep.getConfig().getFileSystem(),
+                    rep.getFileSystem(),
                     subject,
                     hierMgr,
                     wsp.getName());

Modified: incubator/jackrabbit/trunk/jackrabbit/src/main/java/org/apache/jackrabbit/core/config/FileSystemConfig.java
URL: http://svn.apache.org/viewcvs/incubator/jackrabbit/trunk/jackrabbit/src/main/java/org/apache/jackrabbit/core/config/FileSystemConfig.java?rev=386078&r1=386077&r2=386078&view=diff
==============================================================================
--- incubator/jackrabbit/trunk/jackrabbit/src/main/java/org/apache/jackrabbit/core/config/FileSystemConfig.java (original)
+++ incubator/jackrabbit/trunk/jackrabbit/src/main/java/org/apache/jackrabbit/core/config/FileSystemConfig.java Wed Mar 15 06:19:24 2006
@@ -21,18 +21,10 @@
 
 /**
  * File system configuration. This bean configuration class
- * is used to create a configured file system object. The file system
- * is instantiated by the {@link #init() init()} method, and accessible
- * using the {@link #getFileSystem() getFileSystem()} method. Calling
- * {@link #dispose() dispose()} will close and dispose a file system instance
- * previously created by the {@link #init() init()} method.
- *
+ * is used to create a configured file system object.
  */
 public class FileSystemConfig extends BeanConfig {
 
-    /** The initialized file system implementation. */
-    private FileSystem fs;
-
     /**
      * Creates a file system configuration object.
      *
@@ -40,67 +32,27 @@
      */
     public FileSystemConfig(BeanConfig config) {
         super(config);
-        fs = null;
     }
 
     /**
      * Instantiates and initializes the configured file system
      * implementation class.
      *
+     * @return new initialized file system instance.
      * @throws ConfigurationException on file system initialization errors
-     * @throws IllegalStateException if the file system has already been
-     *                               initialized
-     */
-    public void init() throws ConfigurationException, IllegalStateException {
-        if (fs == null) {
-            try {
-                fs = (FileSystem) newInstance();
-                fs.init();
-            } catch (ClassCastException e) {
-                throw new ConfigurationException(
-                        "Invalid file system implementation class "
-                        + getClassName() + ".", e);
-            } catch (FileSystemException e) {
-                throw new ConfigurationException(
-                        "File system initialization failure.", e);
-            }
-        } else {
-            throw new IllegalStateException(
-            "File system has already been initialized.");
-        }
-    }
-
-    /**
-     * Closes and disposes a file system instance previously created by the
-     * {@link #init() init()} method, i.e. resets this instance to the
-     * <i>uninitialized</i> state.
-     */
-    public void dispose() {
-        if (fs != null) {
-            try {
-                fs.close();
-            } catch (FileSystemException fse) {
-                // ignore...
-            }
-            fs = null;
-        } else {
-            throw new IllegalStateException("File system has not been initialized.");
-        }
-    }
-
-    /**
-     * Returns the configured file system. The {@link #init() init()} method
-     * must have been called before this method can be invoked.
-     *
-     * @return configured file system
-     * @throws IllegalStateException if the file system has not been initialized
      */
-    public FileSystem getFileSystem() throws IllegalStateException {
-        if (fs != null) {
+    public FileSystem createFileSystem() throws ConfigurationException {
+        try {
+            FileSystem fs = (FileSystem) newInstance();
+            fs.init();
             return fs;
-        } else {
-            throw new IllegalStateException(
-                    "File system has not been initialized.");
+        } catch (ClassCastException e) {
+            throw new ConfigurationException(
+                    "Invalid file system implementation class "
+                    + getClassName() + ".", e);
+        } catch (FileSystemException e) {
+            throw new ConfigurationException(
+                    "File system initialization failure.", e);
         }
     }
 }

Modified: incubator/jackrabbit/trunk/jackrabbit/src/main/java/org/apache/jackrabbit/core/config/RepositoryConfig.java
URL: http://svn.apache.org/viewcvs/incubator/jackrabbit/trunk/jackrabbit/src/main/java/org/apache/jackrabbit/core/config/RepositoryConfig.java?rev=386078&r1=386077&r2=386078&view=diff
==============================================================================
--- incubator/jackrabbit/trunk/jackrabbit/src/main/java/org/apache/jackrabbit/core/config/RepositoryConfig.java (original)
+++ incubator/jackrabbit/trunk/jackrabbit/src/main/java/org/apache/jackrabbit/core/config/RepositoryConfig.java Wed Mar 15 06:19:24 2006
@@ -52,7 +52,7 @@
  * create configured repository objects.
  * <p>
  * The contained configuration information are: the home directory and name
- * of the repository, the access manager, file system, versioning
+ * of the repository, the access manager, file system and versioning
  * configuration, repository index configuration, the workspace directory,
  * the default workspace name, and the workspace configuration template. In
  * addition the workspace configuration object keeps track of all configured
@@ -244,7 +244,7 @@
             String defaultWorkspace, int workspaceMaxIdleTime,
             Element template, VersioningConfig vc, SearchConfig sc,
             ConfigurationParser parser) {
-        this.workspaces = new HashMap();
+        workspaces = new HashMap();
         this.home = home;
         this.name = name;
         this.amc = amc;
@@ -261,17 +261,17 @@
     }
 
     /**
-     * Initializes the repository configuration. This method first initializes
-     * the repository file system and versioning configurations and then
-     * loads and initializes the configurations for all available workspaces.
+     * Initializes the repository configuration. This method loads the
+     * configurations for all available workspaces.
      *
      * @throws ConfigurationException on initialization errors
+     * @throws IllegalStateException if the repository configuration has already
+     *                               been initialized
      */
-    protected void init() throws ConfigurationException {
-        fsc.init();
-        vc.init();
-        if (sc != null) {
-            sc.init();
+    public void init() throws ConfigurationException, IllegalStateException {
+        if (!workspaces.isEmpty()) {
+            throw new IllegalStateException(
+                    "Repository configuration has already been initialized.");
         }
 
         // Get the physical workspace root directory (create it if not found)
@@ -285,7 +285,7 @@
             // a configuration directoy had been specified; search for
             // workspace configurations in virtual repository file system
             // rather than in physical workspace root directory on disk
-            FileSystem fs = fsc.getFileSystem();
+            FileSystem fs = fsc.createFileSystem();
             try {
                 if (!fs.exists(workspaceConfigDirectory)) {
                     fs.createFolder(workspaceConfigDirectory);
@@ -296,7 +296,6 @@
                                 + FileSystem.SEPARATOR + dirNames[i];
                         WorkspaceConfig wc = loadWorkspaceConfig(fs, configDir);
                         if (wc != null) {
-                            wc.init();
                             addWorkspaceConfig(wc);
                         }
                     }
@@ -306,6 +305,10 @@
                 throw new ConfigurationException(
                         "error while loading workspace configurations from path "
                         + workspaceConfigDirectory, e);
+            } finally {
+                try {
+                    fs.close();
+                } catch (FileSystemException ignore) {}
             }
         } else {
             // search for workspace configurations in physical workspace root
@@ -319,7 +322,6 @@
             for (int i = 0; i < files.length; i++) {
                 WorkspaceConfig wc = loadWorkspaceConfig(files[i]);
                 if (wc != null) {
-                    wc.init();
                     addWorkspaceConfig(wc);
                 }
             }
@@ -475,78 +477,93 @@
             }
         }
 
-        Writer configWriter;
-
-        // get a writer for the workspace configuration file
+        FileSystem virtualFS;
         if (workspaceConfigDirectory != null) {
-            // a configuration directoy had been specified; create workspace
-            // configuration in virtual repository file system rather than
-            // on disk
-            FileSystem fs = fsc.getFileSystem();
-            String configDir = workspaceConfigDirectory
-                    + FileSystem.SEPARATOR + name;
-            String configFile = configDir + FileSystem.SEPARATOR + WORKSPACE_XML;
-            try {
-                // Create the directory
-                fs.createFolder(configDir);
-                configWriter = new OutputStreamWriter(
-                        fs.getOutputStream(configFile));
-            } catch (FileSystemException e) {
-                throw new ConfigurationException(
-                        "failed to create workspace configuration at path "
-                        + configFile, e);
-            }
+            // a configuration directoy had been specified;
+            // workspace configurations are maintained in
+            // virtual repository file system
+            virtualFS = fsc.createFileSystem();
         } else {
-            File file = new File(directory, WORKSPACE_XML);
+            // workspace configurations are maintained on disk
+            virtualFS = null;
+        }
+        try {
+            Writer configWriter;
+
+            // get a writer for the workspace configuration file
+            if (virtualFS != null) {
+                // a configuration directoy had been specified; create workspace
+                // configuration in virtual repository file system rather than
+                // on disk
+                String configDir = workspaceConfigDirectory
+                        + FileSystem.SEPARATOR + name;
+                String configFile = configDir + FileSystem.SEPARATOR + WORKSPACE_XML;
+                try {
+                    // Create the directory
+                    virtualFS.createFolder(configDir);
+                    configWriter = new OutputStreamWriter(
+                            virtualFS.getOutputStream(configFile));
+                } catch (FileSystemException e) {
+                    throw new ConfigurationException(
+                            "failed to create workspace configuration at path "
+                            + configFile, e);
+                }
+            } else {
+                File file = new File(directory, WORKSPACE_XML);
+                try {
+                    configWriter = new FileWriter(file);
+                } catch (IOException e) {
+                    throw new ConfigurationException(
+                            "failed to create workspace configuration at path "
+                            + file.getPath(), e);
+                }
+            }
+
+            // Create the workspace.xml file using the configuration template and
+            // the configuration writer.
             try {
-                configWriter = new FileWriter(file);
-            } catch (IOException e) {
+                template.setAttribute("name", name);
+
+                TransformerFactory factory = TransformerFactory.newInstance();
+                Transformer transformer = factory.newTransformer();
+                transformer.setOutputProperty(OutputKeys.INDENT, "yes");
+                transformer.transform(
+                        new DOMSource(template), new StreamResult(configWriter));
+            } catch (TransformerConfigurationException e) {
                 throw new ConfigurationException(
-                        "failed to create workspace configuration at path "
-                        + file.getPath(), e);
+                        "Cannot create a workspace configuration writer", e);
+            } catch (TransformerException e) {
+                throw new ConfigurationException(
+                        "Cannot create a workspace configuration file", e);
+            } finally {
+                try {
+                    configWriter.close();
+                } catch (IOException ignore) {}
             }
-        }
 
-        // Create the workspace.xml file using the configuration template and
-        // the configuration writer.
-        try {
-            template.setAttribute("name", name);
-
-            TransformerFactory factory = TransformerFactory.newInstance();
-            Transformer transformer = factory.newTransformer();
-            transformer.setOutputProperty(OutputKeys.INDENT, "yes");
-            transformer.transform(
-                    new DOMSource(template), new StreamResult(configWriter));
-        } catch (TransformerConfigurationException e) {
-            throw new ConfigurationException(
-                    "Cannot create a workspace configuration writer", e);
-        } catch (TransformerException e) {
-            throw new ConfigurationException(
-                    "Cannot create a workspace configuration file", e);
+            // Load the created workspace configuration.
+            WorkspaceConfig wc;
+            if (virtualFS != null) {
+                String configDir = workspaceConfigDirectory
+                        + FileSystem.SEPARATOR + name;
+                wc = loadWorkspaceConfig(virtualFS, configDir);
+            } else {
+                wc = loadWorkspaceConfig(directory);
+            }
+            if (wc != null) {
+                addWorkspaceConfig(wc);
+                return wc;
+            } else {
+                throw new ConfigurationException(
+                        "Failed to load the created configuration for workspace "
+                        + name + ".");
+            }
         } finally {
             try {
-                configWriter.close();
-            } catch (IOException ignore) {}
-        }
-
-        // Load the created workspace configuration.
-        WorkspaceConfig wc;
-        if (workspaceConfigDirectory != null) {
-            FileSystem fs = fsc.getFileSystem();
-            String configDir = workspaceConfigDirectory
-                    + FileSystem.SEPARATOR + name;
-            wc = loadWorkspaceConfig(fs, configDir);
-        } else {
-            wc = loadWorkspaceConfig(directory);
-        }
-        if (wc != null) {
-            wc.init();
-            addWorkspaceConfig(wc);
-            return wc;
-        } else {
-            throw new ConfigurationException(
-                    "Failed to load the created configuration for workspace "
-                    + name + ".");
+                if (virtualFS != null) {
+                    virtualFS.close();
+                }
+            } catch (FileSystemException ignore) {}
         }
     }
 
@@ -565,7 +582,6 @@
      */
     public WorkspaceConfig createWorkspaceConfig(String name)
             throws ConfigurationException {
-
         // use workspace template from repository.xml
         return internalCreateWorkspaceConfig(name, template);
     }
@@ -606,12 +622,12 @@
     }
 
     /**
-     * Returns the repository file system implementation.
+     * Returns the repository file system configuration.
      *
-     * @return file system implementation
+     * @return file system configuration
      */
-    public FileSystem getFileSystem() {
-        return fsc.getFileSystem();
+    public FileSystemConfig getFileSystemConfig() {
+        return fsc;
     }
 
     /**

Modified: incubator/jackrabbit/trunk/jackrabbit/src/main/java/org/apache/jackrabbit/core/config/SearchConfig.java
URL: http://svn.apache.org/viewcvs/incubator/jackrabbit/trunk/jackrabbit/src/main/java/org/apache/jackrabbit/core/config/SearchConfig.java?rev=386078&r1=386077&r2=386078&view=diff
==============================================================================
--- incubator/jackrabbit/trunk/jackrabbit/src/main/java/org/apache/jackrabbit/core/config/SearchConfig.java (original)
+++ incubator/jackrabbit/trunk/jackrabbit/src/main/java/org/apache/jackrabbit/core/config/SearchConfig.java Wed Mar 15 06:19:24 2006
@@ -16,8 +16,6 @@
  */
 package org.apache.jackrabbit.core.config;
 
-import org.apache.jackrabbit.core.fs.FileSystem;
-
 import java.util.Properties;
 
 /**
@@ -25,7 +23,7 @@
  * is used to create configured search index objects.
  * <p>
  * In addition to generic bean configuration information, this
- * class also contains an optionally configured file system implementation
+ * class also contains an optional file system configuration
  * used by the search index.
  *
  * @see WorkspaceConfig#getSearchConfig()
@@ -53,17 +51,6 @@
     }
 
     /**
-     * Initializes the search index file system if one is configured.
-     *
-     * @throws ConfigurationException on file system configuration errors
-     */
-    public void init() throws ConfigurationException {
-        if (fsc != null) {
-            fsc.init();
-        }
-    }
-
-    /**
      * Returns the search implementation class name.
      *
      * @return search implementation class name
@@ -73,19 +60,6 @@
     }
 
     /**
-     * Returns the search index file system, or <code>null</code> if none is
-     * configured.
-     *
-     * @return search index file system
-     */
-    public FileSystem getFileSystem() {
-        if (fsc == null) {
-            return null;
-        }
-        return fsc.getFileSystem();
-    }
-
-    /**
      * Returns the configuration for the <code>FileSystem</code> or
      * <code>null</code> if none is configured in this <code>SearchConfig</code>.
      *
@@ -94,5 +68,4 @@
     public FileSystemConfig getFileSystemConfig() {
         return fsc;
     }
-
 }

Modified: incubator/jackrabbit/trunk/jackrabbit/src/main/java/org/apache/jackrabbit/core/config/VersioningConfig.java
URL: http://svn.apache.org/viewcvs/incubator/jackrabbit/trunk/jackrabbit/src/main/java/org/apache/jackrabbit/core/config/VersioningConfig.java?rev=386078&r1=386077&r2=386078&view=diff
==============================================================================
--- incubator/jackrabbit/trunk/jackrabbit/src/main/java/org/apache/jackrabbit/core/config/VersioningConfig.java (original)
+++ incubator/jackrabbit/trunk/jackrabbit/src/main/java/org/apache/jackrabbit/core/config/VersioningConfig.java Wed Mar 15 06:19:24 2006
@@ -62,15 +62,6 @@
     }
 
     /**
-     * Initializes the versioning file system.
-     *
-     * @throws ConfigurationException on file system configuration errors
-     */
-    public void init() throws ConfigurationException {
-        fsc.init();
-    }
-
-    /**
      * Returns the versioning home directory.
      *
      * @return versioning home directory
@@ -80,12 +71,12 @@
     }
 
     /**
-     * Returns the versioning file system implementation.
+     * Returns the configuration for the <code>FileSystem</code>.
      *
-     * @return file system implementation
+     * @return the <code>FileSystemConfig</code> for this <code>VersionConfig</code>.
      */
-    public FileSystem getFileSystem() {
-        return fsc.getFileSystem();
+    public FileSystemConfig getFileSystemConfig() {
+        return fsc;
     }
 
     /**

Modified: incubator/jackrabbit/trunk/jackrabbit/src/main/java/org/apache/jackrabbit/core/config/WorkspaceConfig.java
URL: http://svn.apache.org/viewcvs/incubator/jackrabbit/trunk/jackrabbit/src/main/java/org/apache/jackrabbit/core/config/WorkspaceConfig.java?rev=386078&r1=386077&r2=386078&view=diff
==============================================================================
--- incubator/jackrabbit/trunk/jackrabbit/src/main/java/org/apache/jackrabbit/core/config/WorkspaceConfig.java (original)
+++ incubator/jackrabbit/trunk/jackrabbit/src/main/java/org/apache/jackrabbit/core/config/WorkspaceConfig.java Wed Mar 15 06:19:24 2006
@@ -71,17 +71,6 @@
     }
 
     /**
-     * Initializes the search index implementation.
-     *
-     * @throws ConfigurationException on initialization errors
-     */
-    public void init() throws ConfigurationException {
-        if (sc != null) {
-            sc.init();
-        }
-    }
-
-    /**
      * Returns the workspace home directory.
      *
      * @return workspace home directory

Modified: incubator/jackrabbit/trunk/jackrabbit/src/main/java/org/apache/jackrabbit/core/version/VersionManagerImpl.java
URL: http://svn.apache.org/viewcvs/incubator/jackrabbit/trunk/jackrabbit/src/main/java/org/apache/jackrabbit/core/version/VersionManagerImpl.java?rev=386078&r1=386077&r2=386078&view=diff
==============================================================================
--- incubator/jackrabbit/trunk/jackrabbit/src/main/java/org/apache/jackrabbit/core/version/VersionManagerImpl.java (original)
+++ incubator/jackrabbit/trunk/jackrabbit/src/main/java/org/apache/jackrabbit/core/version/VersionManagerImpl.java Wed Mar 15 06:19:24 2006
@@ -21,6 +21,7 @@
 import org.apache.jackrabbit.core.NodeImpl;
 import org.apache.jackrabbit.core.PropertyId;
 import org.apache.jackrabbit.core.SessionImpl;
+import org.apache.jackrabbit.core.fs.FileSystem;
 import org.apache.jackrabbit.core.nodetype.NodeTypeRegistry;
 import org.apache.jackrabbit.core.observation.DelegatingObservationDispatcher;
 import org.apache.jackrabbit.core.observation.EventStateCollection;
@@ -70,6 +71,11 @@
     private final PersistenceManager pMgr;
 
     /**
+     * The file system for this version manager
+     */
+    private final FileSystem fs;
+
+    /**
      * the shared state manager for the version storage
      */
     private SharedItemStateManager sharedStateMgr;
@@ -108,11 +114,13 @@
      * Creates a bew vesuion manager
      *
      */
-    public VersionManagerImpl(PersistenceManager pMgr, NodeTypeRegistry ntReg,
+    public VersionManagerImpl(PersistenceManager pMgr, FileSystem fs,
+                              NodeTypeRegistry ntReg,
                               DelegatingObservationDispatcher obsMgr, NodeId rootId,
                               NodeId rootParentId) throws RepositoryException {
         try {
             this.pMgr = pMgr;
+            this.fs = fs;
             this.ntReg = ntReg;
             this.obsMgr = obsMgr;
 
@@ -161,6 +169,7 @@
      */
     public void close() throws Exception {
         pMgr.close();
+        fs.close();
     }
 
     /**

Modified: incubator/jackrabbit/trunk/jackrabbit/src/test/java/org/apache/jackrabbit/core/config/WorkspaceConfigTest.java
URL: http://svn.apache.org/viewcvs/incubator/jackrabbit/trunk/jackrabbit/src/test/java/org/apache/jackrabbit/core/config/WorkspaceConfigTest.java?rev=386078&r1=386077&r2=386078&view=diff
==============================================================================
--- incubator/jackrabbit/trunk/jackrabbit/src/test/java/org/apache/jackrabbit/core/config/WorkspaceConfigTest.java (original)
+++ incubator/jackrabbit/trunk/jackrabbit/src/test/java/org/apache/jackrabbit/core/config/WorkspaceConfigTest.java Wed Mar 15 06:19:24 2006
@@ -47,7 +47,6 @@
                 "org/apache/jackrabbit/core/config/workspace.xml");
         WorkspaceConfig config =
             parser.parseWorkspaceConfig(new InputSource(xml));
-        config.init();
 
         assertEquals("target", config.getHomeDir());
         assertEquals("default", config.getName());