cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cohei...@apache.org
Subject cxf-fediz git commit: Close the ApplicationContext
Date Thu, 19 Nov 2015 16:56:14 GMT
Repository: cxf-fediz
Updated Branches:
  refs/heads/master 1f7749cec -> b241d3b5b


Close the ApplicationContext


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

Branch: refs/heads/master
Commit: b241d3b5bfee7648e1fe592eb207263f70815efa
Parents: 1f7749c
Author: Colm O hEigeartaigh <coheigea@apache.org>
Authored: Thu Nov 19 16:55:37 2015 +0000
Committer: Colm O hEigeartaigh <coheigea@apache.org>
Committed: Thu Nov 19 16:56:07 2015 +0000

----------------------------------------------------------------------
 .../apache/cxf/fediz/service/oidc/HomeRealmCallbackHandler.java  | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cxf-fediz/blob/b241d3b5/services/oidc/src/main/java/org/apache/cxf/fediz/service/oidc/HomeRealmCallbackHandler.java
----------------------------------------------------------------------
diff --git a/services/oidc/src/main/java/org/apache/cxf/fediz/service/oidc/HomeRealmCallbackHandler.java
b/services/oidc/src/main/java/org/apache/cxf/fediz/service/oidc/HomeRealmCallbackHandler.java
index 7d85a9d..db93ca2 100644
--- a/services/oidc/src/main/java/org/apache/cxf/fediz/service/oidc/HomeRealmCallbackHandler.java
+++ b/services/oidc/src/main/java/org/apache/cxf/fediz/service/oidc/HomeRealmCallbackHandler.java
@@ -29,6 +29,7 @@ import javax.servlet.http.HttpServletRequest;
 import org.apache.cxf.fediz.core.spi.HomeRealmCallback;
 import org.apache.cxf.rs.security.oauth2.common.Client;
 import org.springframework.context.ApplicationContext;
+import org.springframework.context.support.AbstractApplicationContext;
 import org.springframework.context.support.ClassPathXmlApplicationContext;
 
 public class HomeRealmCallbackHandler implements CallbackHandler {
@@ -38,7 +39,6 @@ public class HomeRealmCallbackHandler implements CallbackHandler {
             if (callbacks[i] instanceof HomeRealmCallback) {
                 HomeRealmCallback callback = (HomeRealmCallback) callbacks[i];
                 
-                @SuppressWarnings("resource")
                 ApplicationContext ctx = new ClassPathXmlApplicationContext("data-manager.xml");
                 OAuthDataManager dataManager = (OAuthDataManager)ctx.getBean("oauthProvider");
                 
@@ -51,6 +51,8 @@ public class HomeRealmCallbackHandler implements CallbackHandler {
                         callback.setHomeRealm(((FedizClient)client).getHomeRealm());
                     }
                 }
+                
+                ((AbstractApplicationContext)ctx).close();
             } else {
                 throw new UnsupportedCallbackException(callbacks[i], "Unrecognized Callback");
             }


Mime
View raw message