cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From serg...@apache.org
Subject cxf git commit: Adding Ehcache provider close method
Date Thu, 26 Nov 2015 21:46:18 GMT
Repository: cxf
Updated Branches:
  refs/heads/3.1.x-fixes 365cbd07b -> 06383eeb3


Adding Ehcache provider close method


Project: http://git-wip-us.apache.org/repos/asf/cxf/repo
Commit: http://git-wip-us.apache.org/repos/asf/cxf/commit/06383eeb
Tree: http://git-wip-us.apache.org/repos/asf/cxf/tree/06383eeb
Diff: http://git-wip-us.apache.org/repos/asf/cxf/diff/06383eeb

Branch: refs/heads/3.1.x-fixes
Commit: 06383eeb3d1ecdb3cf28424c262e11da0ae30600
Parents: 365cbd0
Author: Sergey Beryozkin <sberyozkin@gmail.com>
Authored: Thu Nov 26 21:44:37 2015 +0000
Committer: Sergey Beryozkin <sberyozkin@gmail.com>
Committed: Thu Nov 26 21:46:00 2015 +0000

----------------------------------------------------------------------
 .../oauth2/grants/code/DefaultEHCacheCodeDataProvider.java    | 5 +++--
 .../oauth2/provider/DefaultEHCacheOAuthDataProvider.java      | 7 +++++--
 2 files changed, 8 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cxf/blob/06383eeb/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/grants/code/DefaultEHCacheCodeDataProvider.java
----------------------------------------------------------------------
diff --git a/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/grants/code/DefaultEHCacheCodeDataProvider.java
b/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/grants/code/DefaultEHCacheCodeDataProvider.java
index 1419329..ceb4ba0 100644
--- a/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/grants/code/DefaultEHCacheCodeDataProvider.java
+++ b/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/grants/code/DefaultEHCacheCodeDataProvider.java
@@ -21,6 +21,7 @@ package org.apache.cxf.rs.security.oauth2.grants.code;
 import net.sf.ehcache.Ehcache;
 
 import org.apache.cxf.Bus;
+import org.apache.cxf.BusFactory;
 import org.apache.cxf.rs.security.oauth2.provider.DefaultEHCacheOAuthDataProvider;
 import org.apache.cxf.rs.security.oauth2.provider.OAuthServiceException;
 
@@ -32,7 +33,7 @@ public class DefaultEHCacheCodeDataProvider extends DefaultEHCacheOAuthDataProvi
     private Ehcache codeGrantCache;
     
     protected DefaultEHCacheCodeDataProvider() {
-        this(DEFAULT_CONFIG_URL, null);
+        this(DEFAULT_CONFIG_URL, BusFactory.getThreadDefaultBus(true));
     }
     
     protected DefaultEHCacheCodeDataProvider(String configFileURL, Bus bus) {
@@ -72,7 +73,7 @@ public class DefaultEHCacheCodeDataProvider extends DefaultEHCacheOAuthDataProvi
     protected void saveCodeGrant(ServerAuthorizationCodeGrant grant) { 
         putCacheValue(codeGrantCache, grant.getCode(), grant, grant.getExpiresIn());
     }
-    
+
     public void setCodeLifetime(long codeLifetime) {
         this.codeLifetime = codeLifetime;
     }

http://git-wip-us.apache.org/repos/asf/cxf/blob/06383eeb/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/provider/DefaultEHCacheOAuthDataProvider.java
----------------------------------------------------------------------
diff --git a/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/provider/DefaultEHCacheOAuthDataProvider.java
b/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/provider/DefaultEHCacheOAuthDataProvider.java
index 23891d2..f78d012 100644
--- a/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/provider/DefaultEHCacheOAuthDataProvider.java
+++ b/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/provider/DefaultEHCacheOAuthDataProvider.java
@@ -54,7 +54,7 @@ public class DefaultEHCacheOAuthDataProvider extends AbstractOAuthDataProvider
     private Ehcache refreshTokenCache;
     
     public DefaultEHCacheOAuthDataProvider() {
-        this(DEFAULT_CONFIG_URL, null);
+        this(DEFAULT_CONFIG_URL, BusFactory.getThreadDefaultBus(true));
     }
     
     public DefaultEHCacheOAuthDataProvider(String configFileURL, Bus bus) {
@@ -193,5 +193,8 @@ public class DefaultEHCacheOAuthDataProvider extends AbstractOAuthDataProvider
         refreshTokenCache = createCache(cacheManager, refreshTokenKey);
     }
 
-    
+    public void close() {
+        cacheManager.shutdown();
+    }
+
 }


Mime
View raw message