jackrabbit-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From thom...@apache.org
Subject svn commit: r1170522 - /jackrabbit/sandbox/microkernel/src/main/java/org/apache/jackrabbit/mk/store/PersistenceManager.java
Date Wed, 14 Sep 2011 10:42:11 GMT
Author: thomasm
Date: Wed Sep 14 10:42:11 2011
New Revision: 1170522

URL: http://svn.apache.org/viewvc?rev=1170522&view=rev
Log:
Synchronize the cache.

Modified:
    jackrabbit/sandbox/microkernel/src/main/java/org/apache/jackrabbit/mk/store/PersistenceManager.java

Modified: jackrabbit/sandbox/microkernel/src/main/java/org/apache/jackrabbit/mk/store/PersistenceManager.java
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/microkernel/src/main/java/org/apache/jackrabbit/mk/store/PersistenceManager.java?rev=1170522&r1=1170521&r2=1170522&view=diff
==============================================================================
--- jackrabbit/sandbox/microkernel/src/main/java/org/apache/jackrabbit/mk/store/PersistenceManager.java
(original)
+++ jackrabbit/sandbox/microkernel/src/main/java/org/apache/jackrabbit/mk/store/PersistenceManager.java
Wed Sep 14 10:42:11 2011
@@ -20,6 +20,8 @@ import org.apache.jackrabbit.mk.blobs.Bl
 import org.apache.jackrabbit.mk.util.SimpleLRUCache;
 
 import java.io.InputStream;
+import java.util.Collections;
+import java.util.Map;
 import java.util.concurrent.locks.ReentrantLock;
 
 /**
@@ -32,7 +34,7 @@ public class PersistenceManager {
     RevisionStore revStore;
     BlobStore blobStore;
 
-    SimpleLRUCache cache;
+    Map<String, Object> cache;
 
     public void initialize(RevisionStore revs, BlobStore blobs) throws Exception {
         if (initialized) {
@@ -42,7 +44,7 @@ public class PersistenceManager {
         revStore = revs;
         blobStore = blobs;
 
-        cache = SimpleLRUCache.newInstance(10000);
+        cache = Collections.synchronizedMap(SimpleLRUCache.<String, Object>newInstance(10000));
 
         // make sure we've got a HEAD commit
         String head = revStore.getHeadId();



Mime
View raw message