jackrabbit-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mreut...@apache.org
Subject svn commit: r605173 - in /jackrabbit/trunk/jackrabbit-core/src: main/config/ main/java/org/apache/jackrabbit/core/ main/java/org/apache/jackrabbit/core/config/ main/java/org/apache/jackrabbit/core/state/ main/java/org/apache/jackrabbit/core/version/ ma...
Date Tue, 18 Dec 2007 10:41:56 GMT
Author: mreutegg
Date: Tue Dec 18 02:41:53 2007
New Revision: 605173

URL: http://svn.apache.org/viewvc?rev=605173&view=rev
Log:
JCR-314: Fine grained locking in SharedItemStateManager

Added:
    jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/config/ISMLockingConfig.java
  (with props)
    jackrabbit/trunk/jackrabbit-core/src/main/resources/org/apache/jackrabbit/core/config/repository-1.4.dtd
  (with props)
Modified:
    jackrabbit/trunk/jackrabbit-core/src/main/config/repository.xml
    jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/RepositoryImpl.java
    jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/config/ConfigurationEntityResolver.java
    jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/config/RepositoryConfigurationParser.java
    jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/config/VersioningConfig.java
    jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/config/WorkspaceConfig.java
    jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/state/SharedItemStateManager.java
    jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/version/VersionItemStateManager.java
    jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/version/VersionManagerImpl.java
    jackrabbit/trunk/jackrabbit-core/src/main/resources/org/apache/jackrabbit/core/repository.xml
    jackrabbit/trunk/jackrabbit-core/src/main/resources/org/apache/jackrabbit/core/test-repository.xml
    jackrabbit/trunk/jackrabbit-core/src/test/repository/repository.xml
    jackrabbit/trunk/jackrabbit-core/src/test/resources/org/apache/jackrabbit/core/config/repository.xml

Modified: jackrabbit/trunk/jackrabbit-core/src/main/config/repository.xml
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-core/src/main/config/repository.xml?rev=605173&r1=605172&r2=605173&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-core/src/main/config/repository.xml (original)
+++ jackrabbit/trunk/jackrabbit-core/src/main/config/repository.xml Tue Dec 18 02:41:53 2007
@@ -15,8 +15,8 @@
    See the License for the specific language governing permissions and
    limitations under the License.
 -->
-<!DOCTYPE Repository PUBLIC "-//The Apache Software Foundation//DTD Jackrabbit 1.2//EN"
-                            "http://jackrabbit.apache.org/dtd/repository-1.2.dtd">
+<!DOCTYPE Repository PUBLIC "-//The Apache Software Foundation//DTD Jackrabbit 1.4//EN"
+                            "http://jackrabbit.apache.org/dtd/repository-1.4.dtd">
 <!-- Example Repository Configuration File -->
 <Repository>
     <!--

Modified: jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/RepositoryImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/RepositoryImpl.java?rev=605173&r1=605172&r2=605173&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/RepositoryImpl.java
(original)
+++ jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/RepositoryImpl.java
Tue Dec 18 02:41:53 2007
@@ -58,6 +58,7 @@
 import org.apache.jackrabbit.core.state.ItemStateException;
 import org.apache.jackrabbit.core.state.ManagedMLRUItemStateCacheFactory;
 import org.apache.jackrabbit.core.state.SharedItemStateManager;
+import org.apache.jackrabbit.core.state.ISMLocking;
 import org.apache.jackrabbit.core.util.RepositoryLock;
 import org.apache.jackrabbit.core.value.InternalValue;
 import org.apache.jackrabbit.core.version.VersionManager;
@@ -387,8 +388,11 @@
                 ntReg,
                 dataStore);
 
+        ISMLocking ismLocking = vConfig.getISMLockingConfig().createISMLocking();
+
         return new VersionManagerImpl(pm, fs, ntReg, delegatingDispatcher,
-                VERSION_STORAGE_NODE_ID, SYSTEM_ROOT_NODE_ID, cacheFactory);
+                VERSION_STORAGE_NODE_ID, SYSTEM_ROOT_NODE_ID, cacheFactory,
+                ismLocking);
     }
 
     /**
@@ -1177,10 +1181,11 @@
                                                             NodeId rootNodeId,
                                                             NodeTypeRegistry ntReg,
                                                             boolean usesReferences,
-                                                            ItemStateCacheFactory cacheFactory)
+                                                            ItemStateCacheFactory cacheFactory,
+                                                            ISMLocking locking)
             throws ItemStateException {
 
-        return new SharedItemStateManager(persistMgr, rootNodeId, ntReg, true, cacheFactory);
+        return new SharedItemStateManager(persistMgr, rootNodeId, ntReg, true, cacheFactory,
locking);
     }
 
     //-----------------------------------------------------------< Repository >
@@ -1727,9 +1732,12 @@
                     ntReg,
                     dataStore);
 
+            ISMLocking ismLocking = config.getISMLockingConfig().createISMLocking();
+
             // create item state manager
             try {
-                itemStateMgr = createItemStateManager(persistMgr, rootNodeId, ntReg, true,
cacheFactory);
+                itemStateMgr = createItemStateManager(persistMgr, rootNodeId,
+                        ntReg, true, cacheFactory, ismLocking);
                 try {
                     itemStateMgr.addVirtualItemStateProvider(
                             vMgr.getVirtualItemStateProvider());

Modified: jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/config/ConfigurationEntityResolver.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/config/ConfigurationEntityResolver.java?rev=605173&r1=605172&r2=605173&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/config/ConfigurationEntityResolver.java
(original)
+++ jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/config/ConfigurationEntityResolver.java
Tue Dec 18 02:41:53 2007
@@ -32,10 +32,12 @@
  * <ul>
  * <li><code>-//The Apache Software Foundation//DTD Jackrabbit 1.0//EN</code></li>
  * <li><code>-//The Apache Software Foundation//DTD Jackrabbit 1.2//EN</code></li>
+ * <li><code>-//The Apache Software Foundation//DTD Jackrabbit 1.4//EN</code></li>
  * </ul>
  * <p>
  * Also the following system identifiers are mapped to local resources:
  * <ul>
+ * <li><code>http://jackrabbit.apache.org/dtd/repository-1.4.dtd</code></li>
  * <li><code>http://jackrabbit.apache.org/dtd/repository-1.2.dtd</code></li>
  * <li><code>http://jackrabbit.apache.org/dtd/repository-1.0.dtd</code></li>
  * </ul>
@@ -65,6 +67,14 @@
      * Creates the singleton instance of this class.
      */
     private ConfigurationEntityResolver() {
+        // Apache Jackrabbit 1.4 DTD
+        publicIds.put(
+                "-//The Apache Software Foundation//DTD Jackrabbit 1.4//EN",
+                "repository-1.4.dtd");
+        systemIds.put(
+                "http://jackrabbit.apache.org/dtd/repository-1.4.dtd",
+                "repository-1.4.dtd");
+
         // Apache Jackrabbit 1.2 DTD
         publicIds.put(
                 "-//The Apache Software Foundation//DTD Jackrabbit 1.2//EN",

Added: jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/config/ISMLockingConfig.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/config/ISMLockingConfig.java?rev=605173&view=auto
==============================================================================
--- jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/config/ISMLockingConfig.java
(added)
+++ jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/config/ISMLockingConfig.java
Tue Dec 18 02:41:53 2007
@@ -0,0 +1,62 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.jackrabbit.core.config;
+
+import org.apache.jackrabbit.core.state.ISMLocking;
+
+import java.util.Properties;
+
+/**
+ * ItemStateManager locking configuration. This bean configuration class
+ * is used to create configured ISMLocking objects.
+ *
+ * @see WorkspaceConfig#getISMLockingConfig()
+ * @see VersioningConfig#getISMLockingConfig()
+ */
+public class ISMLockingConfig extends BeanConfig {
+
+    /**
+     * The default ism locking implementation class.
+     */
+    private static final String DEFAULT_ISM_LOCKING_CLASS
+            = "org.apache.jackrabbit.core.state.DefaultISMLocking";
+
+    /**
+     * @return a ISM locking configuration with default values.
+     */
+    public static ISMLockingConfig createDefaultConfig() {
+        return new ISMLockingConfig(DEFAULT_ISM_LOCKING_CLASS, new Properties());
+    }
+
+    /**
+     * Creates a new ISM locking configuration.
+     *
+     * @param className  the class name of the ISM locking implementation.
+     * @param parameters configuration parameters.
+     */
+    public ISMLockingConfig(String className, Properties parameters) {
+        super(className, parameters);
+    }
+
+    /**
+     * @return a new ISMLocking instance based on this configuration.
+     * @throws ConfigurationException on bean configuration errors.
+     */
+    public ISMLocking createISMLocking() throws ConfigurationException {
+        return (ISMLocking) newInstance();
+    }
+}

Propchange: jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/config/ISMLockingConfig.java
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/config/RepositoryConfigurationParser.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/config/RepositoryConfigurationParser.java?rev=605173&r1=605172&r2=605173&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/config/RepositoryConfigurationParser.java
(original)
+++ jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/config/RepositoryConfigurationParser.java
Tue Dec 18 02:41:53 2007
@@ -89,6 +89,9 @@
     /** Name of the search index configuration element. */
     public static final String SEARCH_INDEX_ELEMENT = "SearchIndex";
 
+    /** Name of the ism locking configuration element. */
+    public static final String ISM_LOCKING_ELEMENT = "ISMLocking";
+
     /** Name of the application name configuration attribute. */
     public static final String APP_NAME_ATTRIBUTE = "appName";
 
@@ -296,6 +299,7 @@
      *     &lt;FileSystem ...&gt;
      *     &lt;PersistenceManager ...&gt;
      *     &lt;SearchIndex ...&gt;
+     *     &lt;ISMLocking ...&gt;
      *   &lt;/Workspace&gt;
      * </pre>
      * <p>
@@ -322,6 +326,9 @@
      * The search index configuration element is optional. If it is not given,
      * then the workspace will not have search capabilities.
      * <p>
+     * The ism locking configuration element is optional. If it is not given,
+     * then a default implementation is used.
+     * <p>
      * Note that the returned workspace configuration object has not been
      * initialized.
      *
@@ -361,7 +368,10 @@
         // Search implementation (optional)
         SearchConfig sc = tmpParser.parseSearchConfig(root);
 
-        return new WorkspaceConfig(home, name, clustered, fsc, pmc, sc);
+        // Item state manager locking configuration (optional)
+        ISMLockingConfig ismLockingConfig = tmpParser.parseISMLockingConfig(root);
+
+        return new WorkspaceConfig(home, name, clustered, fsc, pmc, sc, ismLockingConfig);
     }
 
     /**
@@ -421,6 +431,48 @@
     }
 
     /**
+     * Parses ism locking configuration. ism locking configuration  uses the
+     * following format:
+     * <pre>
+     *   &lt;ISMLocking class="..."&gt;
+     *     &lt;param name="..." value="..."&gt;
+     *     ...
+     *   &lt;/ISMLocking&gt;
+     * </pre>
+     * <p/>
+     * The <code>ISMLocking</code> is a
+     * {@link #parseBeanConfig(Element,String) bean configuration} element.
+     * <p/>
+     * The ism locking is an optional part of the  workspace configuration. If
+     * the ism locking element is not found, then this method returns
+     * <code>null</code>.
+     *
+     * @param parent parent of the <code>ISMLocking</code> element
+     * @return search configuration, or <code>null</code>
+     * @throws ConfigurationException if the configuration is broken
+     */
+    protected ISMLockingConfig parseISMLockingConfig(Element parent)
+            throws ConfigurationException {
+        NodeList children = parent.getChildNodes();
+        for (int i = 0; i < children.getLength(); i++) {
+            Node child = children.item(i);
+            if (child.getNodeType() == Node.ELEMENT_NODE
+                    && ISM_LOCKING_ELEMENT.equals(child.getNodeName())) {
+                Element element = (Element) child;
+
+                // ism locking implementation class
+                String className = getAttribute(element, CLASS_ATTRIBUTE);
+
+                // ism locking parameters
+                Properties parameters = parseParameters(element);
+
+                return new ISMLockingConfig(className, parameters);
+            }
+        }
+        return null;
+    }
+
+    /**
      * Parses versioning configuration. Versioning configuration uses the
      * following format:
      * <pre>
@@ -455,7 +507,10 @@
         // Persistence manager implementation
         PersistenceManagerConfig pmc = parsePersistenceManagerConfig(element);
 
-        return new VersioningConfig(home, fsc, pmc);
+        // Item state manager locking configuration (optional)
+        ISMLockingConfig ismLockingConfig = parseISMLockingConfig(element);
+
+        return new VersioningConfig(home, fsc, pmc, ismLockingConfig);
     }
 
     /**

Modified: jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/config/VersioningConfig.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/config/VersioningConfig.java?rev=605173&r1=605172&r2=605173&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/config/VersioningConfig.java
(original)
+++ jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/config/VersioningConfig.java
Tue Dec 18 02:41:53 2007
@@ -46,17 +46,32 @@
     private final PersistenceManagerConfig pmc;
 
     /**
+     * ISM locking configuration
+     */
+    private final ISMLockingConfig ismLockingConfig;
+    
+    /**
      * Creates a versioning configuration object.
      *
-     * @param home home directory
-     * @param fsc file system configuration
-     * @param pmc persistence manager configuration
+     * @param home             home directory
+     * @param fsc              file system configuration
+     * @param pmc              persistence manager configuration
+     * @param ismLockingConfig the item state manager locking configuration, if
+     *                         <code>null</code> is passed a default
+     *                         configuration is used.
      */
-    public VersioningConfig(
-            String home, FileSystemConfig fsc, PersistenceManagerConfig pmc) {
+    public VersioningConfig(String home,
+                            FileSystemConfig fsc,
+                            PersistenceManagerConfig pmc,
+                            ISMLockingConfig ismLockingConfig) {
         this.home = home;
         this.fsc = fsc;
         this.pmc = pmc;
+        if (ismLockingConfig != null) {
+            this.ismLockingConfig = ismLockingConfig;
+        } else {
+            this.ismLockingConfig = ISMLockingConfig.createDefaultConfig();
+        }
     }
 
     /**
@@ -86,4 +101,10 @@
         return pmc;
     }
 
+    /**
+     * @return name of the ISM locking configuration
+     */
+    public ISMLockingConfig getISMLockingConfig() {
+    	return ismLockingConfig;
+    }
 }

Modified: jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/config/WorkspaceConfig.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/config/WorkspaceConfig.java?rev=605173&r1=605172&r2=605173&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/config/WorkspaceConfig.java
(original)
+++ jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/config/WorkspaceConfig.java
Tue Dec 18 02:41:53 2007
@@ -17,13 +17,13 @@
 package org.apache.jackrabbit.core.config;
 
 /**
- * Workspace configuration. This configuration class is used to
- * create configured workspace objects.
- * <p>
- * The contained configuration information are: the home directory and name
- * of the workspace, and the file system, the persistence manager, and the
- * search index configuration. The search index is an optional part of the
- * configuration.
+ * Workspace configuration. This configuration class is used to create
+ * configured workspace objects.
+ * <p/>
+ * The contained configuration information are: the home directory and name of
+ * the workspace, the file system, the persistence manager, the search index and
+ * the item state manager locking configuration. The search index and the item
+ * state manager locking are optional parts.
  */
 public class WorkspaceConfig {
 
@@ -58,6 +58,11 @@
     private SearchConfig sc;
 
     /**
+     * The item state manager locking configuration.
+     */
+    private ISMLockingConfig ismLockingConfig;
+
+    /**
      * Creates a workspace configuration object.
      *
      * @param home home directory
@@ -65,16 +70,23 @@
      * @param fsc file system configuration
      * @param pmc persistence manager configuration
      * @param sc search index configuration
+     * @param ismLockingConfig the item state manager locking configuration. If
+     * <code>null</code> is passed, a default configuration is taken.
      */
     public WorkspaceConfig(String home, String name, boolean clustered,
                            FileSystemConfig fsc, PersistenceManagerConfig pmc,
-                           SearchConfig sc) {
+                           SearchConfig sc, ISMLockingConfig ismLockingConfig) {
         this.home = home;
         this.name = name;
         this.clustered = clustered;
         this.fsc = fsc;
         this.pmc = pmc;
         this.sc = sc;
+        if (ismLockingConfig != null) {
+            this.ismLockingConfig = ismLockingConfig;
+        } else {
+            this.ismLockingConfig = ISMLockingConfig.createDefaultConfig();
+        }
     }
 
     /**
@@ -106,6 +118,13 @@
     }
 
     /**
+     * @return the configuration for the item state locking.
+     */
+    public ISMLockingConfig getISMLockingConfig() {
+    	return ismLockingConfig;
+    }
+    
+    /**
      * Returns the file system configuration.
      *
      * @return file system configuration
@@ -132,5 +151,4 @@
     public SearchConfig getSearchConfig() {
         return sc;
     }
-
 }

Modified: jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/state/SharedItemStateManager.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/state/SharedItemStateManager.java?rev=605173&r1=605172&r2=605173&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/state/SharedItemStateManager.java
(original)
+++ jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/state/SharedItemStateManager.java
Tue Dec 18 02:41:53 2007
@@ -179,14 +179,15 @@
                                   NodeId rootNodeId,
                                   NodeTypeRegistry ntReg,
                                   boolean usesReferences,
-                                  ItemStateCacheFactory cacheFactory)
+                                  ItemStateCacheFactory cacheFactory,
+                                  ISMLocking locking)
             throws ItemStateException {
         cache = new ItemStateReferenceCache(cacheFactory);
         this.persistMgr = persistMgr;
         this.ntReg = ntReg;
         this.usesReferences = usesReferences;
         this.rootNodeId = rootNodeId;
-        this.ismLocking = new DefaultISMLocking();
+        this.ismLocking = locking;
         // create root node state if it doesn't yet exist
         if (!hasNonVirtualItemState(rootNodeId)) {
             createRootNodeState(rootNodeId, ntReg);

Modified: jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/version/VersionItemStateManager.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/version/VersionItemStateManager.java?rev=605173&r1=605172&r2=605173&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/version/VersionItemStateManager.java
(original)
+++ jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/version/VersionItemStateManager.java
Tue Dec 18 02:41:53 2007
@@ -21,6 +21,7 @@
 import org.apache.jackrabbit.core.state.ItemStateException;
 import org.apache.jackrabbit.core.state.ChangeLog;
 import org.apache.jackrabbit.core.state.NodeReferences;
+import org.apache.jackrabbit.core.state.ISMLocking;
 import org.apache.jackrabbit.core.persistence.PersistenceManager;
 import org.apache.jackrabbit.core.NodeId;
 import org.apache.jackrabbit.core.PropertyId;
@@ -50,9 +51,10 @@
     public VersionItemStateManager(PersistenceManager persistMgr,
                                    NodeId rootNodeId,
                                    NodeTypeRegistry ntReg,
-                                   ItemStateCacheFactory cacheFactory)
+                                   ItemStateCacheFactory cacheFactory,
+                                   ISMLocking locking)
             throws ItemStateException {
-        super(persistMgr, rootNodeId, ntReg, false, cacheFactory);
+        super(persistMgr, rootNodeId, ntReg, false, cacheFactory, locking);
         this.pMgr = persistMgr;
     }
 

Modified: jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/version/VersionManagerImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/version/VersionManagerImpl.java?rev=605173&r1=605172&r2=605173&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/version/VersionManagerImpl.java
(original)
+++ jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/version/VersionManagerImpl.java
Tue Dec 18 02:41:53 2007
@@ -40,6 +40,7 @@
 import org.apache.jackrabbit.core.state.NodeState;
 import org.apache.jackrabbit.core.state.PropertyState;
 import org.apache.jackrabbit.core.state.SharedItemStateManager;
+import org.apache.jackrabbit.core.state.ISMLocking;
 import org.apache.jackrabbit.core.value.InternalValue;
 import org.apache.jackrabbit.core.virtual.VirtualItemStateProvider;
 import org.apache.jackrabbit.spi.Path;
@@ -133,7 +134,8 @@
                               NodeTypeRegistry ntReg,
                               DelegatingObservationDispatcher obsMgr, NodeId rootId,
                               NodeId rootParentId,
-                              ItemStateCacheFactory cacheFactory) throws RepositoryException
{
+                              ItemStateCacheFactory cacheFactory,
+                              ISMLocking ismLocking) throws RepositoryException {
         try {
             this.pMgr = pMgr;
             this.fs = fs;
@@ -159,7 +161,7 @@
                 cl.added(pt);
                 pMgr.store(cl);
             }
-            sharedStateMgr = createItemStateManager(pMgr, rootId, ntReg, cacheFactory);
+            sharedStateMgr = createItemStateManager(pMgr, rootId, ntReg, cacheFactory, ismLocking);
 
             stateMgr = new LocalItemStateManager(sharedStateMgr, escFactory, cacheFactory);
             stateMgr.addListener(this);
@@ -451,15 +453,17 @@
      * @param rootId        root node id
      * @param ntReg         node type registry
      * @param cacheFactory  cache factory
+     * @param ismLocking    the ISM locking implementation
      * @return item state manager
      * @throws ItemStateException if an error occurs
      */
     protected VersionItemStateManager createItemStateManager(PersistenceManager pMgr,
                                                              NodeId rootId,
                                                              NodeTypeRegistry ntReg,
-                                                             ItemStateCacheFactory cacheFactory)
+                                                             ItemStateCacheFactory cacheFactory,
+                                                             ISMLocking ismLocking)
             throws ItemStateException {
-        return new VersionItemStateManager(pMgr, rootId, ntReg, cacheFactory);
+        return new VersionItemStateManager(pMgr, rootId, ntReg, cacheFactory, ismLocking);
     }
 
     /**

Added: jackrabbit/trunk/jackrabbit-core/src/main/resources/org/apache/jackrabbit/core/config/repository-1.4.dtd
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-core/src/main/resources/org/apache/jackrabbit/core/config/repository-1.4.dtd?rev=605173&view=auto
==============================================================================
--- jackrabbit/trunk/jackrabbit-core/src/main/resources/org/apache/jackrabbit/core/config/repository-1.4.dtd
(added)
+++ jackrabbit/trunk/jackrabbit-core/src/main/resources/org/apache/jackrabbit/core/config/repository-1.4.dtd
Tue Dec 18 02:41:53 2007
@@ -0,0 +1,174 @@
+<!--
+   Licensed to the Apache Software Foundation (ASF) under one or more
+   contributor license agreements.  See the NOTICE file distributed with
+   this work for additional information regarding copyright ownership.
+   The ASF licenses this file to You under the Apache License, Version 2.0
+   (the "License"); you may not use this file except in compliance with
+   the License.  You may obtain a copy of the License at
+
+       http://www.apache.org/licenses/LICENSE-2.0
+
+   Unless required by applicable law or agreed to in writing, software
+   distributed under the License is distributed on an "AS IS" BASIS,
+   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+   See the License for the specific language governing permissions and
+   limitations under the License.
+-->
+<!--
+    the Repository element configures a repository instance; individual 
+    workspaces of the repository are configured through separate configuration 
+    files called workspace.xml which are located in a subfolder of the 
+    workspaces root directory (see Workspaces element).
+
+    it consists of
+
+      - a FileSystem element (the virtual file system
+        used by the repository to persist global state such as
+        registered namespaces, custom node types, etc..
+
+      - a Security element that specifies the name of the app-entry
+        in the JAAS config and the access manager
+
+      - a Workspaces element that specifies the location of the 
+        workspaces root directory, the name of the default workspace,
+        the maximum idle time before a workspace is automatically
+        shutdown (optional) and the workspace configuration root directory
+        within the virtual repository file system (optional)
+
+      - a Workspace element that is used as a workspace configuration
+        template; it is used to create the initial workspace if there's
+        no workspace yet and for creating additional workspaces through
+        the api
+
+      - a Versioning element that is used for configuring
+        versioning-related settings
+
+      - a SearchIndex element that is used for configuring Indexing-related
+        settings on the /jcr:system tree.
+
+      - a Cluster element that is used for configuring an optional
+        clustering node that synchronizes changes made in a cluster
+       
+-->
+<!ELEMENT Repository (FileSystem,Security,Workspaces,Workspace,Versioning,SearchIndex?,Cluster?)>
+
+<!--
+    a virtual file system
+-->
+<!ELEMENT FileSystem (param*)>
+<!ATTLIST FileSystem class CDATA #REQUIRED>
+
+<!--
+    the Security element specifies the name (appName attribute)
+    of the JAAS configuration app-entry for this repository. 
+
+    it also specifies the access manager to be used (AccessManager element).
+-->
+<!ELEMENT Security (AccessManager, LoginModule?)>
+<!ATTLIST Security appName CDATA #REQUIRED>
+
+<!--
+    the AccessManager element configures the access manager to be used by
+    this repository instance; the class attribute specifies the FQN of the
+    class implementing the AccessManager interface
+-->
+<!ELEMENT AccessManager (param*)>
+<!ATTLIST AccessManager class CDATA #REQUIRED>
+
+<!--
+    generic parameter (name/value pair)
+-->
+<!ELEMENT param EMPTY>
+<!ATTLIST param name  CDATA #REQUIRED
+                value CDATA #REQUIRED>
+
+<!--
+    the LoginModule element optionally specifies a JAAS login module to
+    authenticate users. This feature allows the use of Jackrabbit in a
+    non-JAAS environment.
+-->
+<!ELEMENT LoginModule (param*)>
+<!ATTLIST LoginModule class CDATA #REQUIRED>
+
+<!--
+    the Workspaces element specifies the physical workspaces root directory
+    (rootPath attribute), the name of the default workspace (defaultWorkspace 
+    attribute), the (optional) maximum amount of time in seconds before an idle 
+    workspace is automatically shutdown (maxIdleTime attribute) and the 
+    (optional) workspace configuration root directory within the virtual 
+    repository file system (configRootPath attribute).
+
+    individual workspaces are configured through individual workspace.xml files 
+    located in a subfolder each of either
+
+    a) the physical workspaces root directory
+
+    or, if configRootPath had been specified,
+
+    b) the configuration root directory within the virtual repository file 
+    system.
+-->
+<!ELEMENT Workspaces EMPTY>
+<!ATTLIST Workspaces rootPath         CDATA #REQUIRED
+                     defaultWorkspace CDATA #REQUIRED
+                     configRootPath   CDATA #IMPLIED
+                     maxIdleTime      CDATA #IMPLIED>
+
+<!--
+    the Workspace element serves as a workspace configuration template;
+    it is used to create the initial workspace if there's no workspace yet
+    and for creating additional workspaces through the api
+-->
+<!ELEMENT Workspace (FileSystem,PersistenceManager,SearchIndex?,ISMLocking?)>
+<!ATTLIST Workspace name CDATA #REQUIRED>
+
+<!--
+    the PersistenceManager element configures the persistence manager
+    to be used for the workspace; the class attribute specifies the
+    FQN of the class implementing the PersistenceManager interface
+-->
+<!ELEMENT PersistenceManager (param*)>
+<!ATTLIST PersistenceManager class CDATA #REQUIRED>
+
+<!--
+    the SearchIndex element specifies the locaction of the search index
+    (used by the QueryHandler); the class attribute specifies the
+    FQN of the class implementing the QueryHandler interface.
+-->
+<!ELEMENT SearchIndex (param*,FileSystem?)>
+<!ATTLIST SearchIndex class CDATA #REQUIRED>
+
+<!--
+    the Versioning element configures the persistence manager
+    to be used for persisting version state
+-->
+<!ELEMENT Versioning (FileSystem, PersistenceManager, ISMLocking?)>
+<!ATTLIST Versioning rootPath CDATA #REQUIRED>
+
+<!--
+    the Cluster element configures the optional participation of this
+    repository in a clustered environment. a literal id may be
+    specified that uniquely identifies this node in a cluster, as well
+    as the delay in seconds before changes to the journal are
+    automatically detected.
+-->
+<!ELEMENT Cluster (Journal)>
+<!ATTLIST Cluster id        CDATA #IMPLIED
+                  syncDelay CDATA #IMPLIED>
+
+<!--
+    the Journal element configures the journal used in clustering; the
+    class attribute specifies the FQN of the class implementing the
+    Journal interface.
+-->
+<!ELEMENT Journal (param*)>
+<!ATTLIST Journal class CDATA #REQUIRED>
+
+<!--
+    the ISMLocking element configures the locking implementation
+    to be used for the workspace and version storage; the class
+    attribute specifies the FQN of the class implementing the
+    ISMLocking interface.
+-->
+<!ELEMENT ISMLocking (param*)>
+<!ATTLIST ISMLocking class CDATA #REQUIRED>

Propchange: jackrabbit/trunk/jackrabbit-core/src/main/resources/org/apache/jackrabbit/core/config/repository-1.4.dtd
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: jackrabbit/trunk/jackrabbit-core/src/main/resources/org/apache/jackrabbit/core/repository.xml
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-core/src/main/resources/org/apache/jackrabbit/core/repository.xml?rev=605173&r1=605172&r2=605173&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-core/src/main/resources/org/apache/jackrabbit/core/repository.xml
(original)
+++ jackrabbit/trunk/jackrabbit-core/src/main/resources/org/apache/jackrabbit/core/repository.xml
Tue Dec 18 02:41:53 2007
@@ -15,8 +15,8 @@
    See the License for the specific language governing permissions and
    limitations under the License.
 -->
-<!DOCTYPE Repository PUBLIC "-//The Apache Software Foundation//DTD Jackrabbit 1.2//EN"
-                            "http://jackrabbit.apache.org/dtd/repository-1.2.dtd">
+<!DOCTYPE Repository PUBLIC "-//The Apache Software Foundation//DTD Jackrabbit 1.4//EN"
+                            "http://jackrabbit.apache.org/dtd/repository-1.4.dtd">
 <!-- Example Repository Configuration File -->
 <Repository>
     <!--

Modified: jackrabbit/trunk/jackrabbit-core/src/main/resources/org/apache/jackrabbit/core/test-repository.xml
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-core/src/main/resources/org/apache/jackrabbit/core/test-repository.xml?rev=605173&r1=605172&r2=605173&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-core/src/main/resources/org/apache/jackrabbit/core/test-repository.xml
(original)
+++ jackrabbit/trunk/jackrabbit-core/src/main/resources/org/apache/jackrabbit/core/test-repository.xml
Tue Dec 18 02:41:53 2007
@@ -15,8 +15,8 @@
    See the License for the specific language governing permissions and
    limitations under the License.
 -->
-<!DOCTYPE Repository PUBLIC "-//The Apache Software Foundation//DTD Jackrabbit 1.2//EN"
-                            "http://jackrabbit.apache.org/dtd/repository-1.2.dtd">
+<!DOCTYPE Repository PUBLIC "-//The Apache Software Foundation//DTD Jackrabbit 1.4//EN"
+                            "http://jackrabbit.apache.org/dtd/repository-1.4.dtd">
 <Repository>
     <!--
         virtual file system where the repository stores global state

Modified: jackrabbit/trunk/jackrabbit-core/src/test/repository/repository.xml
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-core/src/test/repository/repository.xml?rev=605173&r1=605172&r2=605173&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-core/src/test/repository/repository.xml (original)
+++ jackrabbit/trunk/jackrabbit-core/src/test/repository/repository.xml Tue Dec 18 02:41:53
2007
@@ -15,8 +15,8 @@
    See the License for the specific language governing permissions and
    limitations under the License.
   -->
-<!DOCTYPE Repository PUBLIC "-//The Apache Software Foundation//DTD Jackrabbit 1.2//EN"
-                            "http://jackrabbit.apache.org/dtd/repository-1.2.dtd">
+<!DOCTYPE Repository PUBLIC "-//The Apache Software Foundation//DTD Jackrabbit 1.4//EN"
+                            "http://jackrabbit.apache.org/dtd/repository-1.4.dtd">
 <!-- Example Repository Configuration File -->
 <Repository>
     <!--

Modified: jackrabbit/trunk/jackrabbit-core/src/test/resources/org/apache/jackrabbit/core/config/repository.xml
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-core/src/test/resources/org/apache/jackrabbit/core/config/repository.xml?rev=605173&r1=605172&r2=605173&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-core/src/test/resources/org/apache/jackrabbit/core/config/repository.xml
(original)
+++ jackrabbit/trunk/jackrabbit-core/src/test/resources/org/apache/jackrabbit/core/config/repository.xml
Tue Dec 18 02:41:53 2007
@@ -15,8 +15,8 @@
    See the License for the specific language governing permissions and
    limitations under the License.
 -->
-<!DOCTYPE Repository PUBLIC "-//The Apache Software Foundation//DTD Jackrabbit 1.2//EN"
-                            "http://jackrabbit.apache.org/dtd/repository-1.2.dtd">
+<!DOCTYPE Repository PUBLIC "-//The Apache Software Foundation//DTD Jackrabbit 1.4//EN"
+                            "http://jackrabbit.apache.org/dtd/repository-1.4.dtd">
 <!-- Example Repository Configuration File -->
 <Repository>
     <!--
@@ -89,6 +89,11 @@
                 <param name="path" value="${wsp.home}/index"/>
             </FileSystem>
         </SearchIndex>
+        <!--
+            The ISM locking implementation.
+            class: FQN of class implementing the ISMLocking interface
+        -->
+        <ISMLocking class="org.apache.jackrabbit.core.state.DefaultISMLocking"/>
     </Workspace>
 
     <!--
@@ -111,5 +116,10 @@
         -->
         <PersistenceManager class="org.apache.jackrabbit.core.persistence.obj.ObjectPersistenceManager"/>
 
+        <!--
+            The ISM locking implementation.
+            class: FQN of class implementing the ISMLocking interface
+        -->
+        <ISMLocking class="org.apache.jackrabbit.core.state.DefaultISMLocking"/>
     </Versioning>
 </Repository>



Mime
View raw message