jackrabbit-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mreut...@apache.org
Subject svn commit: r1445122 - in /jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core: ./ nodetype/ security/authorization/ session/
Date Tue, 12 Feb 2013 12:13:53 GMT
Author: mreutegg
Date: Tue Feb 12 12:13:52 2013
New Revision: 1445122

URL: http://svn.apache.org/r1445122
Log:
JCR-3495: Unregister from PrivilegeRegistry and NodeTypeRegistry on Session.logout() 

Modified:
    jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/SessionImpl.java
    jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/nodetype/NodeTypeManagerImpl.java
    jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/security/authorization/PrivilegeManagerImpl.java
    jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/security/authorization/PrivilegeRegistry.java
    jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/session/SessionContext.java

Modified: jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/SessionImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/SessionImpl.java?rev=1445122&r1=1445121&r2=1445122&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/SessionImpl.java
(original)
+++ jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/SessionImpl.java
Tue Feb 12 12:13:52 2013
@@ -952,6 +952,8 @@ public class SessionImpl extends Abstrac
             // notify listeners that session is about to be closed
             notifyLoggingOut();
 
+            context.getPrivilegeManager().dispose();
+            context.getNodeTypeManager().dispose();
             // dispose session item state manager
             context.getItemStateManager().dispose();
             // dispose item manager

Modified: jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/nodetype/NodeTypeManagerImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/nodetype/NodeTypeManagerImpl.java?rev=1445122&r1=1445121&r2=1445122&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/nodetype/NodeTypeManagerImpl.java
(original)
+++ jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/nodetype/NodeTypeManagerImpl.java
Tue Feb 12 12:13:52 2013
@@ -126,6 +126,13 @@ public class NodeTypeManagerImpl extends
     }
 
     /**
+     * Disposes this node type manager.
+     */
+    public void dispose() {
+        context.getNodeTypeRegistry().removeListener(this);
+    }
+
+    /**
      * @return the root node definition
      */
     public NodeDefinitionImpl getRootNodeDefinition() {

Modified: jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/security/authorization/PrivilegeManagerImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/security/authorization/PrivilegeManagerImpl.java?rev=1445122&r1=1445121&r2=1445122&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/security/authorization/PrivilegeManagerImpl.java
(original)
+++ jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/security/authorization/PrivilegeManagerImpl.java
Tue Feb 12 12:13:52 2013
@@ -77,6 +77,13 @@ public final class PrivilegeManagerImpl 
         registry.addListener(this);
     }
 
+    /**
+     * Disposes this privilege manager
+     */
+    public void dispose() {
+        registry.removeListener(this);
+    }
+
     //---------------------------------------------------< PrivilegeManager >---
     /**
      * @see PrivilegeManager#getRegisteredPrivileges()

Modified: jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/security/authorization/PrivilegeRegistry.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/security/authorization/PrivilegeRegistry.java?rev=1445122&r1=1445121&r2=1445122&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/security/authorization/PrivilegeRegistry.java
(original)
+++ jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/security/authorization/PrivilegeRegistry.java
Tue Feb 12 12:13:52 2013
@@ -665,6 +665,15 @@ public final class PrivilegeRegistry imp
         listeners.put(listener,listener);
     }
 
+    /**
+     * Removes a privilege registration listener.
+     *
+     * @param listener
+     */
+    public void removeListener(Listener listener) {
+        listeners.remove(listener);
+    }
+
     //---------------------------------------------< privilege registration >---
     /**
      * Register the specified custom privilege definitions.

Modified: jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/session/SessionContext.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/session/SessionContext.java?rev=1445122&r1=1445121&r2=1445122&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/session/SessionContext.java
(original)
+++ jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/session/SessionContext.java
Tue Feb 12 12:13:52 2013
@@ -88,7 +88,7 @@ public class SessionContext implements N
     /**
      * Privilege manager of this session.
      */
-    private final PrivilegeManager privilegeManager;
+    private final PrivilegeManagerImpl privilegeManager;
 
     /**
      * The namespace registry exposed for this session context that includes
@@ -246,7 +246,7 @@ public class SessionContext implements N
      *
      * @return the privilege manager.
      */
-    public PrivilegeManager getPrivilegeManager() {
+    public PrivilegeManagerImpl getPrivilegeManager() {
         return privilegeManager;
     }
 



Mime
View raw message