brooklyn-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From aleds...@apache.org
Subject [2/7] brooklyn-server git commit: Don't cache the delegatinProvider in a static field as that's causing test failures (when reloading properties with a different security provider). DelegatingSecurityProvider caches the delegate in mgmt so re-creating it
Date Wed, 16 Nov 2016 22:33:06 GMT
Don't cache the delegatinProvider in a static field as that's causing test failures (when reloading
properties with a different security provider). DelegatingSecurityProvider caches the delegate
in mgmt so re-creating it for the same mgmt is cheap.


Project: http://git-wip-us.apache.org/repos/asf/brooklyn-server/repo
Commit: http://git-wip-us.apache.org/repos/asf/brooklyn-server/commit/de0af81a
Tree: http://git-wip-us.apache.org/repos/asf/brooklyn-server/tree/de0af81a
Diff: http://git-wip-us.apache.org/repos/asf/brooklyn-server/diff/de0af81a

Branch: refs/heads/master
Commit: de0af81a09aeec28d9b6dcef498299fd379c095c
Parents: cd07d81
Author: Svetoslav Neykov <svetoslav.neykov@cloudsoftcorp.com>
Authored: Mon Nov 14 12:09:57 2016 +0200
Committer: Svetoslav Neykov <svetoslav.neykov@cloudsoftcorp.com>
Committed: Mon Nov 14 12:09:57 2016 +0200

----------------------------------------------------------------------
 .../rest/security/jaas/BrooklynLoginModule.java      | 15 ++-------------
 1 file changed, 2 insertions(+), 13 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/brooklyn-server/blob/de0af81a/rest/rest-resources/src/main/java/org/apache/brooklyn/rest/security/jaas/BrooklynLoginModule.java
----------------------------------------------------------------------
diff --git a/rest/rest-resources/src/main/java/org/apache/brooklyn/rest/security/jaas/BrooklynLoginModule.java
b/rest/rest-resources/src/main/java/org/apache/brooklyn/rest/security/jaas/BrooklynLoginModule.java
index 75ddd32..6fc2efe 100644
--- a/rest/rest-resources/src/main/java/org/apache/brooklyn/rest/security/jaas/BrooklynLoginModule.java
+++ b/rest/rest-resources/src/main/java/org/apache/brooklyn/rest/security/jaas/BrooklynLoginModule.java
@@ -139,7 +139,6 @@ public class BrooklynLoginModule implements LoginModule {
     private Map<String, ?> options;
     private BundleContext bundleContext;
 
-    private static DelegatingSecurityProvider defaultProvider;
     private HttpSession providerSession;
 
     private SecurityProvider provider;
@@ -152,18 +151,8 @@ public class BrooklynLoginModule implements LoginModule {
     public BrooklynLoginModule() {
     }
 
-    private SecurityProvider getDefaultProvider() {
-        if (defaultProvider == null) {
-            createDefaultSecurityProvider(getManagementContext());
-        }
-        return defaultProvider;
-    }
-
     private synchronized static SecurityProvider createDefaultSecurityProvider(ManagementContext
mgmt) {
-        if (defaultProvider == null) {
-            defaultProvider = new DelegatingSecurityProvider(mgmt);
-        }
-        return defaultProvider;
+        return new DelegatingSecurityProvider(mgmt);
     }
 
     private ManagementContext getManagementContext() {
@@ -218,7 +207,7 @@ public class BrooklynLoginModule implements LoginModule {
             }
         } else {
             log.debug("Delegating security provider loading to Brooklyn.");
-            provider = getDefaultProvider();
+            provider = createDefaultSecurityProvider(getManagementContext());
         }
 
         log.debug("Using security provider " + provider);


Mime
View raw message