Author: mcucchiara
Date: Sun Oct 16 22:58:05 2011
New Revision: 1184953

URL: http://svn.apache.org/viewvc?rev=1184953&view=rev
Log:
Allow to dynamically change securityManager implementation

Modified:
    
commons/proper/ognl/branches/new-cache-approach/src/main/java/org/apache/commons/ognl/OgnlRuntime.java
    
commons/proper/ognl/branches/new-cache-approach/src/main/java/org/apache/commons/ognl/internal/entry/MethodPermCacheEntryFactory.java

Modified: 
commons/proper/ognl/branches/new-cache-approach/src/main/java/org/apache/commons/ognl/OgnlRuntime.java
URL: 
http://svn.apache.org/viewvc/commons/proper/ognl/branches/new-cache-approach/src/main/java/org/apache/commons/ognl/OgnlRuntime.java?rev=1184953&r1=1184952&r2=1184953&view=diff
==============================================================================
--- 
commons/proper/ognl/branches/new-cache-approach/src/main/java/org/apache/commons/ognl/OgnlRuntime.java
 (original)
+++ 
commons/proper/ognl/branches/new-cache-approach/src/main/java/org/apache/commons/ognl/OgnlRuntime.java
 Sun Oct 16 22:58:05 2011
@@ -217,8 +217,11 @@ public class OgnlRuntime
 
     static final IntHashMap<Integer, Boolean> _methodAccessCache = new 
IntHashMap<Integer, Boolean>( );
 
+    private static final MethodPermCacheEntryFactory 
methodPermCacheEntryFactory =
+        new MethodPermCacheEntryFactory( _securityManager );
+
     static final Cache<Method, Boolean> _methodPermCache =
-        new ConcurrentHashMapCache<Method, Boolean>( new 
MethodPermCacheEntryFactory( _securityManager ) );
+        new ConcurrentHashMapCache<Method, Boolean>( 
methodPermCacheEntryFactory );
 
     static ClassCacheInspector _cacheInspector;
 
@@ -744,6 +747,7 @@ public class OgnlRuntime
     public static void setSecurityManager( SecurityManager value )
     {
         _securityManager = value;
+        methodPermCacheEntryFactory.setSecurityManager( value );
     }
 
     /**

Modified: 
commons/proper/ognl/branches/new-cache-approach/src/main/java/org/apache/commons/ognl/internal/entry/MethodPermCacheEntryFactory.java
URL: 
http://svn.apache.org/viewvc/commons/proper/ognl/branches/new-cache-approach/src/main/java/org/apache/commons/ognl/internal/entry/MethodPermCacheEntryFactory.java?rev=1184953&r1=1184952&r2=1184953&view=diff
==============================================================================
--- 
commons/proper/ognl/branches/new-cache-approach/src/main/java/org/apache/commons/ognl/internal/entry/MethodPermCacheEntryFactory.java
 (original)
+++ 
commons/proper/ognl/branches/new-cache-approach/src/main/java/org/apache/commons/ognl/internal/entry/MethodPermCacheEntryFactory.java
 Sun Oct 16 22:58:05 2011
@@ -34,4 +34,9 @@ public class MethodPermCacheEntryFactory
         }
 
     }
+
+    public void setSecurityManager( SecurityManager securityManager )
+    {
+        this.securityManager = securityManager;
+    }
 }


Reply via email to