geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From a..@apache.org
Subject svn commit: r154421 - geronimo/trunk/modules/security/src/java/org/apache/geronimo/security/jacc/GeronimoPolicy.java
Date Sat, 19 Feb 2005 16:58:41 GMT
Author: adc
Date: Sat Feb 19 08:58:40 2005
New Revision: 154421

URL: http://svn.apache.org/viewcvs?view=rev&rev=154421
Log:
Lazily cache the reference to the factory.

Modified:
    geronimo/trunk/modules/security/src/java/org/apache/geronimo/security/jacc/GeronimoPolicy.java

Modified: geronimo/trunk/modules/security/src/java/org/apache/geronimo/security/jacc/GeronimoPolicy.java
URL: http://svn.apache.org/viewcvs/geronimo/trunk/modules/security/src/java/org/apache/geronimo/security/jacc/GeronimoPolicy.java?view=diff&r1=154420&r2=154421
==============================================================================
--- geronimo/trunk/modules/security/src/java/org/apache/geronimo/security/jacc/GeronimoPolicy.java
(original)
+++ geronimo/trunk/modules/security/src/java/org/apache/geronimo/security/jacc/GeronimoPolicy.java
Sat Feb 19 08:58:40 2005
@@ -32,14 +32,14 @@
  */
 public class GeronimoPolicy extends Policy {
     private final Policy root;
-    private final GeronimoPolicyConfigurationFactory factory;
+    private GeronimoPolicyConfigurationFactory factory;
+    private boolean loaded;
 
     public GeronimoPolicy() {
         this(null);
     }
 
     public GeronimoPolicy(Policy root) {
-        this.factory = obtainFactory();
         this.root = root;
     }
 
@@ -51,6 +51,11 @@
     }
 
     public boolean implies(ProtectionDomain domain, Permission permission) {
+
+        if (!loaded) {
+            factory = obtainFactory();
+            loaded = true;
+        }
 
         if (factory != null) {
             String contextID = PolicyContext.getContextID();



Mime
View raw message