jackrabbit-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ju...@apache.org
Subject svn commit: r1530009 - in /jackrabbit/branches/2.6: ./ jackrabbit-core/src/main/java/org/apache/jackrabbit/core/security/user/MembershipCache.java
Date Mon, 07 Oct 2013 17:48:46 GMT
Author: jukka
Date: Mon Oct  7 17:48:46 2013
New Revision: 1530009

URL: http://svn.apache.org/r1530009
Log:
2.6: Merged revision 1530005 (JCR-3678)

Modified:
    jackrabbit/branches/2.6/   (props changed)
    jackrabbit/branches/2.6/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/security/user/MembershipCache.java

Propchange: jackrabbit/branches/2.6/
------------------------------------------------------------------------------
  Merged /jackrabbit/trunk:r1530005

Modified: jackrabbit/branches/2.6/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/security/user/MembershipCache.java
URL: http://svn.apache.org/viewvc/jackrabbit/branches/2.6/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/security/user/MembershipCache.java?rev=1530009&r1=1530008&r2=1530009&view=diff
==============================================================================
--- jackrabbit/branches/2.6/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/security/user/MembershipCache.java
(original)
+++ jackrabbit/branches/2.6/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/security/user/MembershipCache.java
Mon Oct  7 17:48:46 2013
@@ -57,20 +57,25 @@ public class MembershipCache implements 
      */
     private static final Logger log = LoggerFactory.getLogger(MembershipCache.class);
 
+    /**
+     * The maximum size of this cache
+     */
+    private static final int MAX_CACHE_SIZE =
+            Integer.getInteger("org.apache.jackrabbit.MembershipCache", 5000);
+
     private final SessionImpl systemSession;
     private final String groupsPath;
     private final boolean useMembersNode;
     private final String pMembers;
     private final Map<String, Collection<String>> cache;
 
-    @SuppressWarnings("unchecked")
     MembershipCache(SessionImpl systemSession, String groupsPath, boolean useMembersNode)
throws RepositoryException {
         this.systemSession = systemSession;
         this.groupsPath = (groupsPath == null) ? UserConstants.GROUPS_PATH : groupsPath;
         this.useMembersNode = useMembersNode;
 
         pMembers = systemSession.getJCRName(UserManagerImpl.P_MEMBERS);
-        cache = new GrowingLRUMap(1024, 5000);
+        cache = new GrowingLRUMap(1024, MAX_CACHE_SIZE);
 
         String[] ntNames = new String[] {
                 systemSession.getJCRName(UserConstants.NT_REP_GROUP),



Mime
View raw message