cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cohei...@apache.org
Subject svn commit: r1431982 - /cxf/fediz/trunk/services/idp/src/main/java/org/apache/cxf/fediz/service/idp/STSClientFilter.java
Date Fri, 11 Jan 2013 10:46:07 GMT
Author: coheigea
Date: Fri Jan 11 10:46:07 2013
New Revision: 1431982

URL: http://svn.apache.org/viewvc?rev=1431982&view=rev
Log:
[FEDIZ-35] - Allow to use a custom CXF bus for IdpSTSClient

Modified:
    cxf/fediz/trunk/services/idp/src/main/java/org/apache/cxf/fediz/service/idp/STSClientFilter.java

Modified: cxf/fediz/trunk/services/idp/src/main/java/org/apache/cxf/fediz/service/idp/STSClientFilter.java
URL: http://svn.apache.org/viewvc/cxf/fediz/trunk/services/idp/src/main/java/org/apache/cxf/fediz/service/idp/STSClientFilter.java?rev=1431982&r1=1431981&r2=1431982&view=diff
==============================================================================
--- cxf/fediz/trunk/services/idp/src/main/java/org/apache/cxf/fediz/service/idp/STSClientFilter.java
(original)
+++ cxf/fediz/trunk/services/idp/src/main/java/org/apache/cxf/fediz/service/idp/STSClientFilter.java
Fri Jan 11 10:46:07 2013
@@ -90,6 +90,8 @@ public class STSClientFilter extends Abs
     protected String appliesTo; // $wtrealm
     protected String contentType;  //token, rstr
 
+    protected Bus bus;
+
     @Override
     public void init(FilterConfig filterConfig) throws ServletException {
         super.init(filterConfig);
@@ -188,9 +190,9 @@ public class STSClientFilter extends Abs
                 return;
             }
 
-            Bus bus = BusFactory.getDefaultBus();
+            Bus cxfBus = getBus();
 
-            IdpSTSClient sts = new IdpSTSClient(bus);
+            IdpSTSClient sts = new IdpSTSClient(cxfBus);
             sts.setAddressingNamespace("http://www.w3.org/2005/08/addressing");
             if (tokenType != null && tokenType.length() > 0) {
                 sts.setTokenType(tokenType);
@@ -240,7 +242,7 @@ public class STSClientFilter extends Abs
 
             if (this.claimsRequired) {
                 List<String> realmClaims = null;
-                ApplicationContext ctx = (ApplicationContext) bus
+                ApplicationContext ctx = (ApplicationContext) cxfBus
                 .getExtension(ApplicationContext.class);
                 try {
                     @SuppressWarnings("unchecked")
@@ -344,4 +346,12 @@ public class STSClientFilter extends Abs
         return writer.getDocument().getDocumentElement();
     }
 
+    public void setBus(Bus bus) {
+        this.bus = bus;
+    }
+
+    public Bus getBus() {
+        // do not store a referance to the default bus
+        return (bus != null) ? bus : BusFactory.getDefaultBus();
+    }
 }



Mime
View raw message