jackrabbit-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mreut...@apache.org
Subject svn commit: r555986 - in /jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi: WorkspaceManager.java nodetype/BitsetENTCacheImpl.java nodetype/EffectiveNodeTypeCache.java nodetype/NodeTypeRegistryImpl.java
Date Fri, 13 Jul 2007 13:28:33 GMT
Author: mreutegg
Date: Fri Jul 13 06:28:32 2007
New Revision: 555986

URL: http://svn.apache.org/viewvc?view=rev&rev=555986
Log:
JCR-1032: Clean caches in node type registry on session logout

Modified:
    jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/WorkspaceManager.java
    jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/nodetype/BitsetENTCacheImpl.java
    jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/nodetype/EffectiveNodeTypeCache.java
    jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/nodetype/NodeTypeRegistryImpl.java

Modified: jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/WorkspaceManager.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/WorkspaceManager.java?view=diff&rev=555986&r1=555985&r2=555986
==============================================================================
--- jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/WorkspaceManager.java
(original)
+++ jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/WorkspaceManager.java
Fri Jul 13 06:28:32 2007
@@ -128,7 +128,7 @@
     private final CacheBehaviour cacheBehaviour;
 
     private final NamespaceRegistryImpl nsRegistry;
-    private final NodeTypeRegistry ntRegistry;
+    private final NodeTypeRegistryImpl ntRegistry;
     private final ItemDefinitionProvider definitionProvider;
 
     /**
@@ -381,7 +381,7 @@
      * @param nsRegistry
      * @return
      */
-    private NodeTypeRegistry createNodeTypeRegistry(NamespaceRegistry nsRegistry) {
+    private NodeTypeRegistryImpl createNodeTypeRegistry(NamespaceRegistry nsRegistry) {
         NodeTypeStorage ntst = new NodeTypeStorage() {
             public Iterator getAllDefinitions() throws RepositoryException {
                 return service.getQNodeTypeDefinitions(sessionInfo);
@@ -498,6 +498,7 @@
         } finally {
             updateSync.release();
         }
+        ntRegistry.dispose();
     }
     //------------------------------------------------------< AccessManager >---
     /**

Modified: jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/nodetype/BitsetENTCacheImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/nodetype/BitsetENTCacheImpl.java?view=diff&rev=555986&r1=555985&r2=555986
==============================================================================
--- jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/nodetype/BitsetENTCacheImpl.java
(original)
+++ jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/nodetype/BitsetENTCacheImpl.java
Fri Jul 13 06:28:32 2007
@@ -152,6 +152,15 @@
     }
 
     /**
+     * {@inheritDoc}
+     */
+    public void clear() {
+        sortedKeys.clear();
+        aggregates.clear();
+        nameIndex.clear();
+    }
+
+    /**
      * Returns the bit number for the given name. If the name does not exist
      * a new new bit number for that name is created.
      *

Modified: jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/nodetype/EffectiveNodeTypeCache.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/nodetype/EffectiveNodeTypeCache.java?view=diff&rev=555986&r1=555985&r2=555986
==============================================================================
--- jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/nodetype/EffectiveNodeTypeCache.java
(original)
+++ jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/nodetype/EffectiveNodeTypeCache.java
Fri Jul 13 06:28:32 2007
@@ -87,6 +87,11 @@
     Key findBest(Key key);
 
     /**
+     * Clears the cache.
+     */
+    void clear();
+
+    /**
     * An <code>ENTKey</code> uniquely identifies
     * a combination (i.e. an aggregation) of one or more node types.
     */

Modified: jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/nodetype/NodeTypeRegistryImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/nodetype/NodeTypeRegistryImpl.java?view=diff&rev=555986&r1=555985&r2=555986
==============================================================================
--- jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/nodetype/NodeTypeRegistryImpl.java
(original)
+++ jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/nodetype/NodeTypeRegistryImpl.java
Fri Jul 13 06:28:32 2007
@@ -92,6 +92,17 @@
     }
 
     /**
+     * Clears all caches.
+     */
+    public synchronized void dispose() {
+        entCache.clear();
+        registeredNTDefs.clear();
+        propDefs.clear();
+        nodeDefs.clear();
+        listeners.clear();
+    }
+
+    /**
      * Private constructor
      *
      * @param storage
@@ -632,7 +643,7 @@
         }
 
         public void clear() {
-            throw new UnsupportedOperationException("Implementation missing");
+            nodetypeDefinitions.clear();
         }
 
         public boolean isEmpty() {



Mime
View raw message