jackrabbit-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mdue...@apache.org
Subject svn commit: r1176462 - in /jackrabbit/sandbox/jackrabbit-mk: jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/ jackrabbit-jcr2spi/src/test/java/org/apache/jackrabbit/jcr2spi/ jackrabbit-jcr2spi/src/test/java/org/apache/jackrabbit/jcr2spi/...
Date Tue, 27 Sep 2011 16:37:43 GMT
Author: mduerig
Date: Tue Sep 27 16:37:42 2011
New Revision: 1176462

URL: http://svn.apache.org/viewvc?rev=1176462&view=rev
Log:
Microkernel based Jackrabbit prototype (WIP)
refactor: move getItemInfoCache method from RepositoryService to SessionInfo

Modified:
    jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/WorkspaceManager.java
    jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/test/java/org/apache/jackrabbit/jcr2spi/AbstractJCR2SPITest.java
    jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/test/java/org/apache/jackrabbit/jcr2spi/benchmark/ReadPerformanceTest.java
    jackrabbit/sandbox/jackrabbit-mk/jackrabbit-spi-commons/src/main/java/org/apache/jackrabbit/spi/commons/AbstractReadableRepositoryService.java
    jackrabbit/sandbox/jackrabbit-mk/jackrabbit-spi-commons/src/main/java/org/apache/jackrabbit/spi/commons/SessionInfoImpl.java
    jackrabbit/sandbox/jackrabbit-mk/jackrabbit-spi-commons/src/main/java/org/apache/jackrabbit/spi/commons/logging/RepositoryServiceLogger.java
    jackrabbit/sandbox/jackrabbit-mk/jackrabbit-spi-commons/src/main/java/org/apache/jackrabbit/spi/commons/logging/SessionInfoLogger.java
    jackrabbit/sandbox/jackrabbit-mk/jackrabbit-spi/src/main/java/org/apache/jackrabbit/spi/RepositoryService.java
    jackrabbit/sandbox/jackrabbit-mk/jackrabbit-spi/src/main/java/org/apache/jackrabbit/spi/SessionInfo.java
    jackrabbit/sandbox/jackrabbit-mk/jackrabbit-spi2microkernel/src/main/java/org/apache/jackrabbit/spi2microkernel/RepositoryServiceImpl.java

Modified: jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/WorkspaceManager.java
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/WorkspaceManager.java?rev=1176462&r1=1176461&r2=1176462&view=diff
==============================================================================
--- jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/WorkspaceManager.java
(original)
+++ jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/WorkspaceManager.java
Tue Sep 27 16:37:42 2011
@@ -143,7 +143,7 @@ public final class WorkspaceManager impl
     private volatile Subscription subscription;
 
     /**
-     * A cache for item infos as supplied by {@link RepositoryService#getItemInfoCache(SessionInfo)}
+     * A cache for item infos as supplied by {@link SessionInfo#getItemInfoCache()}
      */
     private ItemInfoCache cache;
 
@@ -423,7 +423,7 @@ public final class WorkspaceManager impl
      * @throws RepositoryException If an error occurs.
      */
     private TransientItemStateFactory createItemStateFactory() throws RepositoryException
{
-        cache = service.getItemInfoCache(sessionInfo);
+        cache = sessionInfo.getItemInfoCache();
         WorkspaceItemStateFactory isf = new WorkspaceItemStateFactory(service, sessionInfo,
                 getItemDefinitionProvider(), cache);
 

Modified: jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/test/java/org/apache/jackrabbit/jcr2spi/AbstractJCR2SPITest.java
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/test/java/org/apache/jackrabbit/jcr2spi/AbstractJCR2SPITest.java?rev=1176462&r1=1176461&r2=1176462&view=diff
==============================================================================
--- jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/test/java/org/apache/jackrabbit/jcr2spi/AbstractJCR2SPITest.java
(original)
+++ jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/test/java/org/apache/jackrabbit/jcr2spi/AbstractJCR2SPITest.java
Tue Sep 27 16:37:42 2011
@@ -25,7 +25,6 @@ import org.apache.jackrabbit.spi.EventFi
 import org.apache.jackrabbit.spi.IdFactory;
 import org.apache.jackrabbit.spi.ItemId;
 import org.apache.jackrabbit.spi.ItemInfo;
-import org.apache.jackrabbit.spi.ItemInfoCache;
 import org.apache.jackrabbit.spi.LockInfo;
 import org.apache.jackrabbit.spi.Name;
 import org.apache.jackrabbit.spi.NameFactory;
@@ -258,10 +257,6 @@ public abstract class AbstractJCR2SPITes
         return repositoryService.getRepositoryDescriptors();
     }
 
-    public ItemInfoCache getItemInfoCache(SessionInfo sessionInfo) throws RepositoryException
{
-        return repositoryService.getItemInfoCache(sessionInfo);
-    }
-
     //-----------------------------------< SessionInfo creation and release >---
 
     public SessionInfo obtain(Credentials credentials, String workspaceName) throws RepositoryException
{

Modified: jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/test/java/org/apache/jackrabbit/jcr2spi/benchmark/ReadPerformanceTest.java
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/test/java/org/apache/jackrabbit/jcr2spi/benchmark/ReadPerformanceTest.java?rev=1176462&r1=1176461&r2=1176462&view=diff
==============================================================================
--- jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/test/java/org/apache/jackrabbit/jcr2spi/benchmark/ReadPerformanceTest.java
(original)
+++ jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/test/java/org/apache/jackrabbit/jcr2spi/benchmark/ReadPerformanceTest.java
Tue Sep 27 16:37:42 2011
@@ -30,7 +30,6 @@ import org.apache.jackrabbit.spi.Reposit
 import org.apache.jackrabbit.spi.SessionInfo;
 import org.apache.jackrabbit.spi.commons.ItemInfoBuilder.NodeInfoBuilder;
 import org.apache.jackrabbit.spi.commons.ItemInfoBuilder.PropertyInfoBuilder;
-import org.apache.jackrabbit.spi.commons.ItemInfoCacheImpl;
 import org.apache.jackrabbit.spi.commons.util.Predicate1;
 
 import javax.jcr.Item;
@@ -102,15 +101,6 @@ public class ReadPerformanceTest extends
     private final Random rnd = new Random(12345);
 
     /**
-     * This implementation overrides the default cache size with the value of
-     * {@value #ITEM_INFO_CACHE_SIZE}
-     */
-    @Override
-    public ItemInfoCache getItemInfoCache(SessionInfo sessionInfo) throws RepositoryException
{
-        return new ItemInfoCacheImpl(ITEM_INFO_CACHE_SIZE);
-    }
-
-    /**
      * This implementation adds a tree of nodes and properties up to certain {@link #TREE_DEPTH}.
      * Each node has {@link #NODE_COUNT} child nodes and {@link #PROPERTY_COUNT} properties.
      * {@inheritDoc}

Modified: jackrabbit/sandbox/jackrabbit-mk/jackrabbit-spi-commons/src/main/java/org/apache/jackrabbit/spi/commons/AbstractReadableRepositoryService.java
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/jackrabbit-mk/jackrabbit-spi-commons/src/main/java/org/apache/jackrabbit/spi/commons/AbstractReadableRepositoryService.java?rev=1176462&r1=1176461&r2=1176462&view=diff
==============================================================================
--- jackrabbit/sandbox/jackrabbit-mk/jackrabbit-spi-commons/src/main/java/org/apache/jackrabbit/spi/commons/AbstractReadableRepositoryService.java
(original)
+++ jackrabbit/sandbox/jackrabbit-mk/jackrabbit-spi-commons/src/main/java/org/apache/jackrabbit/spi/commons/AbstractReadableRepositoryService.java
Tue Sep 27 16:37:42 2011
@@ -19,7 +19,6 @@ package org.apache.jackrabbit.spi.common
 import org.apache.jackrabbit.commons.cnd.ParseException;
 import org.apache.jackrabbit.spi.ItemId;
 import org.apache.jackrabbit.spi.ItemInfo;
-import org.apache.jackrabbit.spi.ItemInfoCache;
 import org.apache.jackrabbit.spi.NodeId;
 import org.apache.jackrabbit.spi.NodeInfo;
 import org.apache.jackrabbit.spi.QValue;
@@ -113,16 +112,6 @@ public abstract class AbstractReadableRe
         return super.createSessionInfo(userId, workspaceName == null? defaultWsp : workspaceName);
     }
 
-    // -------------------------------------------------------------< cache >---
-    /**
-     * @param sessionInfo
-     * @return a new instance of {@code ItemInfoCacheImpl}
-     */
-    @Override
-    public ItemInfoCache getItemInfoCache(SessionInfo sessionInfo) {
-        return new ItemInfoCacheImpl();
-    }
-
     //------------------------------------------------------------< reading >---
     /**
      * This default implementation returns the first item returned by the call to

Modified: jackrabbit/sandbox/jackrabbit-mk/jackrabbit-spi-commons/src/main/java/org/apache/jackrabbit/spi/commons/SessionInfoImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/jackrabbit-mk/jackrabbit-spi-commons/src/main/java/org/apache/jackrabbit/spi/commons/SessionInfoImpl.java?rev=1176462&r1=1176461&r2=1176462&view=diff
==============================================================================
--- jackrabbit/sandbox/jackrabbit-mk/jackrabbit-spi-commons/src/main/java/org/apache/jackrabbit/spi/commons/SessionInfoImpl.java
(original)
+++ jackrabbit/sandbox/jackrabbit-mk/jackrabbit-spi-commons/src/main/java/org/apache/jackrabbit/spi/commons/SessionInfoImpl.java
Tue Sep 27 16:37:42 2011
@@ -16,6 +16,7 @@
  */
 package org.apache.jackrabbit.spi.commons;
 
+import org.apache.jackrabbit.spi.ItemInfoCache;
 import org.apache.jackrabbit.spi.SessionInfo;
 
 import javax.jcr.RepositoryException;
@@ -50,6 +51,8 @@ public class SessionInfoImpl implements 
      */
     private final List<String> lockTokens = new ArrayList<String>();
 
+    private ItemInfoCacheImpl itemInfoCache;
+
     /**
      * Sets the userId.
      *
@@ -102,6 +105,18 @@ public class SessionInfoImpl implements 
     }
 
     /**
+     * @return  an ItemInfoCacheImpl instance
+     * @throws RepositoryException
+     */
+    @Override
+    public ItemInfoCache getItemInfoCache() throws RepositoryException {
+        if (itemInfoCache == null) {
+            itemInfoCache = new ItemInfoCacheImpl();
+        }
+        return itemInfoCache;
+    }
+
+    /**
      * Empty implementation
      */
     @Override

Modified: jackrabbit/sandbox/jackrabbit-mk/jackrabbit-spi-commons/src/main/java/org/apache/jackrabbit/spi/commons/logging/RepositoryServiceLogger.java
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/jackrabbit-mk/jackrabbit-spi-commons/src/main/java/org/apache/jackrabbit/spi/commons/logging/RepositoryServiceLogger.java?rev=1176462&r1=1176461&r2=1176462&view=diff
==============================================================================
--- jackrabbit/sandbox/jackrabbit-mk/jackrabbit-spi-commons/src/main/java/org/apache/jackrabbit/spi/commons/logging/RepositoryServiceLogger.java
(original)
+++ jackrabbit/sandbox/jackrabbit-mk/jackrabbit-spi-commons/src/main/java/org/apache/jackrabbit/spi/commons/logging/RepositoryServiceLogger.java
Tue Sep 27 16:37:42 2011
@@ -124,16 +124,6 @@ public class RepositoryServiceLogger ext
     }
 
     @Override
-    public ItemInfoCache getItemInfoCache(final SessionInfo sessionInfo) throws RepositoryException
{
-        return execute(new Callable<ItemInfoCache>() {
-            @Override
-            public ItemInfoCache call() throws RepositoryException {
-                return service.getItemInfoCache(sessionInfo);
-            }
-        }, "getItemInfoCache(SessionInfo)", new Object[]{sessionInfo});
-    }
-
-    @Override
     public SessionInfo obtain(final Credentials credentials, final String workspaceName)
             throws RepositoryException {
 

Modified: jackrabbit/sandbox/jackrabbit-mk/jackrabbit-spi-commons/src/main/java/org/apache/jackrabbit/spi/commons/logging/SessionInfoLogger.java
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/jackrabbit-mk/jackrabbit-spi-commons/src/main/java/org/apache/jackrabbit/spi/commons/logging/SessionInfoLogger.java?rev=1176462&r1=1176461&r2=1176462&view=diff
==============================================================================
--- jackrabbit/sandbox/jackrabbit-mk/jackrabbit-spi-commons/src/main/java/org/apache/jackrabbit/spi/commons/logging/SessionInfoLogger.java
(original)
+++ jackrabbit/sandbox/jackrabbit-mk/jackrabbit-spi-commons/src/main/java/org/apache/jackrabbit/spi/commons/logging/SessionInfoLogger.java
Tue Sep 27 16:37:42 2011
@@ -16,6 +16,7 @@
  */
 package org.apache.jackrabbit.spi.commons.logging;
 
+import org.apache.jackrabbit.spi.ItemInfoCache;
 import org.apache.jackrabbit.spi.SessionInfo;
 
 import javax.jcr.RepositoryException;
@@ -110,6 +111,16 @@ public class SessionInfoLogger extends A
     }
 
     @Override
+    public ItemInfoCache getItemInfoCache() throws RepositoryException {
+        return execute(new Callable<ItemInfoCache>() {
+            @Override
+            public ItemInfoCache call() throws RepositoryException {
+                return sessionInfo.getItemInfoCache();
+            }
+        }, "getItemInfoCache()", new Object[]{});
+    }
+
+    @Override
     public void refresh() {
         execute(new SafeCallable<String>() {
             @Override

Modified: jackrabbit/sandbox/jackrabbit-mk/jackrabbit-spi/src/main/java/org/apache/jackrabbit/spi/RepositoryService.java
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/jackrabbit-mk/jackrabbit-spi/src/main/java/org/apache/jackrabbit/spi/RepositoryService.java?rev=1176462&r1=1176461&r2=1176462&view=diff
==============================================================================
--- jackrabbit/sandbox/jackrabbit-mk/jackrabbit-spi/src/main/java/org/apache/jackrabbit/spi/RepositoryService.java
(original)
+++ jackrabbit/sandbox/jackrabbit-mk/jackrabbit-spi/src/main/java/org/apache/jackrabbit/spi/RepositoryService.java
Tue Sep 27 16:37:42 2011
@@ -110,14 +110,6 @@ public interface RepositoryService {
      */
     QValueFactory getQValueFactory() throws RepositoryException;
 
-    /**
-     * Returns a {@link ItemInfoCache} for the given {@code SessionInfo}.
-     * @param sessionInfo
-     * @return
-     * @throws RepositoryException
-     */
-    ItemInfoCache getItemInfoCache(SessionInfo sessionInfo) throws RepositoryException;
-
     //--------------------------------------------------------------------------
     /**
      * Returns all property descriptors that can be exposed with the

Modified: jackrabbit/sandbox/jackrabbit-mk/jackrabbit-spi/src/main/java/org/apache/jackrabbit/spi/SessionInfo.java
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/jackrabbit-mk/jackrabbit-spi/src/main/java/org/apache/jackrabbit/spi/SessionInfo.java?rev=1176462&r1=1176461&r2=1176462&view=diff
==============================================================================
--- jackrabbit/sandbox/jackrabbit-mk/jackrabbit-spi/src/main/java/org/apache/jackrabbit/spi/SessionInfo.java
(original)
+++ jackrabbit/sandbox/jackrabbit-mk/jackrabbit-spi/src/main/java/org/apache/jackrabbit/spi/SessionInfo.java
Tue Sep 27 16:37:42 2011
@@ -100,6 +100,13 @@ public interface SessionInfo {
     void setUserData(String userData) throws RepositoryException;
 
     /**
+     * Returns a {@link ItemInfoCache} for this session.
+     * @return
+     * @throws RepositoryException
+     */
+    ItemInfoCache getItemInfoCache() throws RepositoryException;
+
+    /**
      * Notification about a {@link javax.jcr.Session#refresh(boolean)} call. Implementations
need to ensure
      * that after this call all infos returned by {@link RepositoryService#getItemInfos(SessionInfo,
ItemId)}
      * reflect the state of the persistence layer not later than from the time of this method
call. That is,

Modified: jackrabbit/sandbox/jackrabbit-mk/jackrabbit-spi2microkernel/src/main/java/org/apache/jackrabbit/spi2microkernel/RepositoryServiceImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/jackrabbit-mk/jackrabbit-spi2microkernel/src/main/java/org/apache/jackrabbit/spi2microkernel/RepositoryServiceImpl.java?rev=1176462&r1=1176461&r2=1176462&view=diff
==============================================================================
--- jackrabbit/sandbox/jackrabbit-mk/jackrabbit-spi2microkernel/src/main/java/org/apache/jackrabbit/spi2microkernel/RepositoryServiceImpl.java
(original)
+++ jackrabbit/sandbox/jackrabbit-mk/jackrabbit-spi2microkernel/src/main/java/org/apache/jackrabbit/spi2microkernel/RepositoryServiceImpl.java
Tue Sep 27 16:37:42 2011
@@ -33,7 +33,6 @@ import org.apache.jackrabbit.spi.EventFi
 import org.apache.jackrabbit.spi.IdFactory;
 import org.apache.jackrabbit.spi.ItemId;
 import org.apache.jackrabbit.spi.ItemInfo;
-import org.apache.jackrabbit.spi.ItemInfoCache;
 import org.apache.jackrabbit.spi.LockInfo;
 import org.apache.jackrabbit.spi.Name;
 import org.apache.jackrabbit.spi.NodeId;
@@ -49,7 +48,6 @@ import org.apache.jackrabbit.spi.Session
 import org.apache.jackrabbit.spi.Subscription;
 import org.apache.jackrabbit.spi.commons.AbstractRepositoryService;
 import org.apache.jackrabbit.spi.commons.EventFilterImpl;
-import org.apache.jackrabbit.spi.commons.ItemInfoCacheImpl;
 import org.apache.jackrabbit.spi.commons.QNodeDefinitionImpl;
 import org.apache.jackrabbit.spi.commons.batch.ConsolidatingChangeLog;
 import org.apache.jackrabbit.spi.commons.name.NameConstants;
@@ -245,11 +243,6 @@ public class RepositoryServiceImpl exten
     }
 
     @Override
-    public ItemInfoCache getItemInfoCache(SessionInfo sessionInfo) throws RepositoryException
{
-        return new ItemInfoCacheImpl();
-    }
-
-    @Override
     protected QNodeDefinition createRootNodeDefinition(SessionInfo sessionInfo) throws RepositoryException
{
         return ROOT_NODE_DEFINITION;
     }



Mime
View raw message