jackrabbit-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ju...@apache.org
Subject svn commit: r1232546 - in /jackrabbit/branches/2.4: ./ jackrabbit-core/src/main/java/org/apache/jackrabbit/core/ jackrabbit-core/src/main/java/org/apache/jackrabbit/core/config/ jackrabbit-core/src/main/resources/org/apache/jackrabbit/core/config/ jack...
Date Tue, 17 Jan 2012 19:27:11 GMT
Author: jukka
Date: Tue Jan 17 19:27:10 2012
New Revision: 1232546

URL: http://svn.apache.org/viewvc?rev=1232546&view=rev
Log:
2.4: Merged revision 1231204 (JCR-3199)

Modified:
    jackrabbit/branches/2.4/   (props changed)
    jackrabbit/branches/2.4/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/NodeImpl.java
    jackrabbit/branches/2.4/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/config/RepositoryConfigurationParser.java
    jackrabbit/branches/2.4/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/config/WorkspaceConfig.java
    jackrabbit/branches/2.4/jackrabbit-core/src/main/resources/org/apache/jackrabbit/core/config/repository-2.4-elements.dtd
    jackrabbit/branches/2.4/jackrabbit-core/src/test/repository/workspaces/default/workspace.xml

Propchange: jackrabbit/branches/2.4/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Tue Jan 17 19:27:10 2012
@@ -1,3 +1,3 @@
 /jackrabbit/branches/JCR-2272:1173165-1176545
 /jackrabbit/sandbox/JCR-2415-lucene-3.0:1060860-1064038
-/jackrabbit/trunk:1221447,1221579,1221593,1221789,1221818,1225179,1225191,1225196,1225207,1225525,1225528,1226452,1226472,1226515,1226750,1226863,1227171,1227240,1227590,1227593,1227615,1228058,1228149,1228155,1228160,1230507,1230681,1230688,1232100
+/jackrabbit/trunk:1221447,1221579,1221593,1221789,1221818,1225179,1225191,1225196,1225207,1225525,1225528,1226452,1226472,1226515,1226750,1226863,1227171,1227240,1227590,1227593,1227615,1228058,1228149,1228155,1228160,1230507,1230681,1230688,1231204,1232100

Modified: jackrabbit/branches/2.4/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/NodeImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/branches/2.4/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/NodeImpl.java?rev=1232546&r1=1232545&r2=1232546&view=diff
==============================================================================
--- jackrabbit/branches/2.4/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/NodeImpl.java
(original)
+++ jackrabbit/branches/2.4/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/NodeImpl.java
Tue Jan 17 19:27:10 2012
@@ -2953,7 +2953,8 @@ public class NodeImpl extends ItemImpl i
         // check state of this instance
         sanityCheck();
         LockManager lockMgr = getSession().getWorkspace().getLockManager();
-        return lockMgr.lock(getPath(), isDeep, isSessionScoped, Long.MAX_VALUE, null);
+        return lockMgr.lock(getPath(), isDeep, isSessionScoped,
+                sessionContext.getWorkspace().getConfig().getDefaultLockTimeout(), null);
     }
 
     /**

Modified: jackrabbit/branches/2.4/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/config/RepositoryConfigurationParser.java
URL: http://svn.apache.org/viewvc/jackrabbit/branches/2.4/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/config/RepositoryConfigurationParser.java?rev=1232546&r1=1232545&r2=1232546&view=diff
==============================================================================
--- jackrabbit/branches/2.4/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/config/RepositoryConfigurationParser.java
(original)
+++ jackrabbit/branches/2.4/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/config/RepositoryConfigurationParser.java
Tue Jan 17 19:27:10 2012
@@ -553,8 +553,7 @@ public class RepositoryConfigurationPars
         String home = getVariables().getProperty(WORKSPACE_HOME_VARIABLE);
 
         // Workspace name
-        String name =
-            getAttribute(root, NAME_ATTRIBUTE, new File(home).getName());
+        String name = getAttribute(root, "name", new File(home).getName());
 
         // Clustered attribute
         boolean clustered = Boolean.valueOf(
@@ -582,12 +581,22 @@ public class RepositoryConfigurationPars
         // workspace specific security configuration
         WorkspaceSecurityConfig workspaceSecurityConfig = tmpParser.parseWorkspaceSecurityConfig(root);
 
-        // optinal config for import handling
+        // optional config for import handling
         ImportConfig importConfig = tmpParser.parseImportConfig(root);
 
+        // default lock timeout
+        String to = getAttribute(root, "defaultLockTimeout", new Long(Long.MAX_VALUE).toString());
+        long defaultLockTimeout;
+        try {
+            defaultLockTimeout = Long.parseLong(to);
+        }
+        catch (NumberFormatException ex) {
+            throw new ConfigurationException("defaultLockTimeout must be an integer value",
ex);
+        }
+
         return new WorkspaceConfig(
                 home, name, clustered, fsf, pmc, qhf,
-                ismLockingFactory, workspaceSecurityConfig, importConfig);
+                ismLockingFactory, workspaceSecurityConfig, importConfig, defaultLockTimeout);
     }
 
     /**

Modified: jackrabbit/branches/2.4/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/config/WorkspaceConfig.java
URL: http://svn.apache.org/viewvc/jackrabbit/branches/2.4/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/config/WorkspaceConfig.java?rev=1232546&r1=1232545&r2=1232546&view=diff
==============================================================================
--- jackrabbit/branches/2.4/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/config/WorkspaceConfig.java
(original)
+++ jackrabbit/branches/2.4/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/config/WorkspaceConfig.java
Tue Jan 17 19:27:10 2012
@@ -88,6 +88,11 @@ public class WorkspaceConfig
     private final ImportConfig importConfig;
 
     /**
+     * Default lock timeout in seconds.
+     */
+    private final long defaultLockTimeout;
+
+    /**
      * Creates a workspace configuration object.
      *
      * @param home home directory
@@ -104,7 +109,7 @@ public class WorkspaceConfig
                            QueryHandlerFactory qhf,
                            ISMLockingFactory ismLockingFactory,
                            WorkspaceSecurityConfig workspaceSecurityConfig) {
-        this(home, name, clustered, fsf, pmc, qhf, ismLockingFactory, workspaceSecurityConfig,
null);
+        this(home, name, clustered, fsf, pmc, qhf, ismLockingFactory, workspaceSecurityConfig,
null, Long.MAX_VALUE);
     }
 
     /**
@@ -125,6 +130,25 @@ public class WorkspaceConfig
                            ISMLockingFactory ismLockingFactory,
                            WorkspaceSecurityConfig workspaceSecurityConfig,
                            ImportConfig importConfig) {
+        this(home, name, clustered, fsf, pmc, qhf, ismLockingFactory, workspaceSecurityConfig,
importConfig, Long.MAX_VALUE);
+    }
+
+    /**
+     * Creates a workspace configuration object.
+     *
+     * @param home home directory
+     * @param name workspace name
+     * @param clustered
+     * @param fsf file system factory
+     * @param pmc persistence manager configuration
+     * @param qhf query handler factory, or <code>null</code> if not configured
+     * @param ismLockingFactory the item state manager locking factory
+     * @param workspaceSecurityConfig the workspace specific security configuration.
+     * @param defaultLockTimeout default timeout for locks (in seconds)
+     */
+    public WorkspaceConfig(String home, String name, boolean clustered, FileSystemFactory
fsf,
+            PersistenceManagerConfig pmc, QueryHandlerFactory qhf, ISMLockingFactory ismLockingFactory,
+            WorkspaceSecurityConfig workspaceSecurityConfig, ImportConfig importConfig, long
defaultLockTimeout) {
         this.home = home;
         this.name = name;
         this.clustered = clustered;
@@ -134,6 +158,7 @@ public class WorkspaceConfig
         this.ismLockingFactory = ismLockingFactory;
         this.workspaceSecurityConfig = workspaceSecurityConfig;
         this.importConfig = importConfig;
+        this.defaultLockTimeout = defaultLockTimeout;
     }
 
     /**
@@ -165,6 +190,17 @@ public class WorkspaceConfig
     }
 
     /**
+     * Returns the default lock timeout in number of seconds or
+     * <code>Long.MAX_VALUE</code> when not specified.
+     * 
+     * @return default lock timeout in number of seconds or
+     *         <code>Long.MAX_VALUE</code> when not specified
+     */
+    public long getDefaultLockTimeout() {
+        return defaultLockTimeout;
+    }
+
+    /**
      * Creates and returns the configured workspace locking strategy.
      *
      * @return the configured {@link ISMLocking}

Modified: jackrabbit/branches/2.4/jackrabbit-core/src/main/resources/org/apache/jackrabbit/core/config/repository-2.4-elements.dtd
URL: http://svn.apache.org/viewvc/jackrabbit/branches/2.4/jackrabbit-core/src/main/resources/org/apache/jackrabbit/core/config/repository-2.4-elements.dtd?rev=1232546&r1=1232545&r2=1232546&view=diff
==============================================================================
--- jackrabbit/branches/2.4/jackrabbit-core/src/main/resources/org/apache/jackrabbit/core/config/repository-2.4-elements.dtd
(original)
+++ jackrabbit/branches/2.4/jackrabbit-core/src/main/resources/org/apache/jackrabbit/core/config/repository-2.4-elements.dtd
Tue Jan 17 19:27:10 2012
@@ -105,6 +105,7 @@
 <!ELEMENT Workspaces EMPTY>
 <!ATTLIST Workspaces rootPath         CDATA #REQUIRED
                      defaultWorkspace CDATA #REQUIRED
+                     defaultLockTimeout CDATA #IMPLIED
                      configRootPath   CDATA #IMPLIED
                      maxIdleTime      CDATA #IMPLIED>
 

Modified: jackrabbit/branches/2.4/jackrabbit-core/src/test/repository/workspaces/default/workspace.xml
URL: http://svn.apache.org/viewvc/jackrabbit/branches/2.4/jackrabbit-core/src/test/repository/workspaces/default/workspace.xml?rev=1232546&r1=1232545&r2=1232546&view=diff
==============================================================================
--- jackrabbit/branches/2.4/jackrabbit-core/src/test/repository/workspaces/default/workspace.xml
(original)
+++ jackrabbit/branches/2.4/jackrabbit-core/src/test/repository/workspaces/default/workspace.xml
Tue Jan 17 19:27:10 2012
@@ -15,7 +15,7 @@
    See the License for the specific language governing permissions and
    limitations under the License.
   -->
-<Workspace name="default">
+<Workspace name="default" defaultLockTimeout="86400">
   <!--
       virtual file system of the workspace:
       class: FQN of class implementing FileSystem interface



Mime
View raw message