jackrabbit-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mdue...@apache.org
Subject svn commit: r1170856 - in /jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi: ItemCache.java ItemCacheImpl.java SessionImpl.java
Date Wed, 14 Sep 2011 21:34:25 GMT
Author: mduerig
Date: Wed Sep 14 21:34:25 2011
New Revision: 1170856

URL: http://svn.apache.org/viewvc?rev=1170856&view=rev
Log:
Microkernel based Jackrabbit prototype (WIP) 
refactor: remove ItemCache interface

Added:
    jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/ItemCache.java
      - copied, changed from r1170850, jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/ItemCacheImpl.java
Modified:
    jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/ItemCacheImpl.java
    jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/SessionImpl.java

Copied: jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/ItemCache.java
(from r1170850, jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/ItemCacheImpl.java)
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/ItemCache.java?p2=jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/ItemCache.java&p1=jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/ItemCacheImpl.java&r1=1170850&r2=1170856&rev=1170856&view=diff
==============================================================================
--- jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/ItemCacheImpl.java
(original)
+++ jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/ItemCache.java
Wed Sep 14 21:34:25 2011
@@ -30,23 +30,33 @@ import static org.apache.jackrabbit.spi.
 /**
  * {@code ItemCacheImpl}...
  */
-public class ItemCacheImpl implements ItemCache {
-    private static final Logger log = LoggerFactory.getLogger(ItemCacheImpl.class);
+public class ItemCache implements ItemLifeCycleListener {
+    private static final Logger log = LoggerFactory.getLogger(ItemCache.class);
 
     private final Map<ItemState, Item> cache;
 
-    ItemCacheImpl(int maxSize) {
+    ItemCache(int maxSize) {
         cache = cast(new LRUMap(maxSize));
     }
 
     //----------------------------------------------------------< ItemCache >---
 
-    @Override
+    /**
+    * Returns the cached {@code Item} that belongs to the given
+    * {@code ItemState} or {@code null} if the cache does not
+    * contain that {@code Item}.
+    *
+    * @param state State of the item that should be retrieved.
+    * @return The item reference stored in the corresponding cache entry
+    * or {@code null} if there's no corresponding cache entry.
+    */
     public Item getItem(ItemState state) {
         return cache.get(state);
     }
 
-    @Override
+    /**
+     * Clear all entries in the ItemCache and free resources.
+     */
     public void clear() {
         cache.clear();
     }

Modified: jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/SessionImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/SessionImpl.java?rev=1170856&r1=1170855&r2=1170856&view=diff
==============================================================================
--- jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/SessionImpl.java
(original)
+++ jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/SessionImpl.java
Wed Sep 14 21:34:25 2011
@@ -148,7 +148,7 @@ public class SessionImpl extends Abstrac
                 getQValueFactory(), workspace.getItemStateFactory(), this);
         
         HierarchyManagerImpl hMgr = getHierarchyManager();
-        ItemCache cache = new ItemCacheImpl(this.config.getItemCacheSize());
+        ItemCache cache = new ItemCache(this.config.getItemCacheSize());
         itemManager = new ItemManager(hMgr, this, cache);
 
         if (hMgr instanceof HierarchyManagerImpl) {



Mime
View raw message