jena-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From a...@apache.org
Subject [2/3] jena git commit: Add createMRPlusSW
Date Sun, 21 Feb 2016 18:20:21 GMT
Add createMRPlusSW


Project: http://git-wip-us.apache.org/repos/asf/jena/repo
Commit: http://git-wip-us.apache.org/repos/asf/jena/commit/2f80d36f
Tree: http://git-wip-us.apache.org/repos/asf/jena/tree/2f80d36f
Diff: http://git-wip-us.apache.org/repos/asf/jena/diff/2f80d36f

Branch: refs/heads/master
Commit: 2f80d36f5c676095f00d502e84bef7b5f8601d86
Parents: a6fb88f
Author: Andy Seaborne <andy@apache.org>
Authored: Sun Feb 21 11:22:23 2016 +0000
Committer: Andy Seaborne <andy@apache.org>
Committed: Sun Feb 21 11:22:23 2016 +0000

----------------------------------------------------------------------
 .../java/org/apache/jena/sparql/core/TransactionalLock.java | 9 +++++++++
 1 file changed, 9 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/jena/blob/2f80d36f/jena-arq/src/main/java/org/apache/jena/sparql/core/TransactionalLock.java
----------------------------------------------------------------------
diff --git a/jena-arq/src/main/java/org/apache/jena/sparql/core/TransactionalLock.java b/jena-arq/src/main/java/org/apache/jena/sparql/core/TransactionalLock.java
index a4de693..e65199b 100644
--- a/jena-arq/src/main/java/org/apache/jena/sparql/core/TransactionalLock.java
+++ b/jena-arq/src/main/java/org/apache/jena/sparql/core/TransactionalLock.java
@@ -22,6 +22,7 @@ import java.util.Objects ;
 
 import org.apache.jena.query.ReadWrite ;
 import org.apache.jena.shared.Lock ;
+import org.apache.jena.shared.LockMRPlusSW ;
 import org.apache.jena.shared.LockMRSW ;
 import org.apache.jena.shared.LockMutex ;
 import org.apache.jena.sparql.JenaTransactionException ;
@@ -56,14 +57,22 @@ public class TransactionalLock implements Transactional {
     private final ThreadLocal<ReadWrite> txnMode  = ThreadLocal.withInitial( ()->null
) ;
     private final Lock lock ;
 
+    /** Create a Transactional using the given lock */
     public static TransactionalLock create(Lock lock) {
         return new TransactionalLock(lock) ;
     }
 
+    /** Create a Transactional using a MR+SW (Multiple Reader AND a Single Writer) lock */
+    public static TransactionalLock createMRPlusSW() {
+        return create(new LockMRPlusSW()) ;
+    }
+
+    /** Create a Transactional using a MRSW (Multiple Reader OR a Single Writer) lock */
     public static TransactionalLock createMRSW() {
         return create(new LockMRSW()) ;
     }
     
+    /** Create a Transactional using a mutex (exclusive - one at a time) lock */
     public static TransactionalLock createMutex() {
         return create(new LockMutex()) ;
     }


Mime
View raw message