cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dk...@apache.org
Subject svn commit: r1205581 - in /cxf/branches/2.4.x-fixes: ./ rt/ws/security/src/main/java/org/apache/cxf/ws/security/policy/interceptors/IssuedTokenInterceptorProvider.java
Date Wed, 23 Nov 2011 20:49:11 GMT
Author: dkulp
Date: Wed Nov 23 20:49:10 2011
New Revision: 1205581

URL: http://svn.apache.org/viewvc?rev=1205581&view=rev
Log:
Merged revisions 1204665 via svnmerge from 
https://svn.apache.org/repos/asf/cxf/trunk

........
  r1204665 | dkulp | 2011-11-21 14:43:33 -0500 (Mon, 21 Nov 2011) | 2 lines
  
  Check a message property for the token if caching on the endpoint is
  turned off.  Avoid a synchronized block if the TokenStore is available.
........

Modified:
    cxf/branches/2.4.x-fixes/   (props changed)
    cxf/branches/2.4.x-fixes/rt/ws/security/src/main/java/org/apache/cxf/ws/security/policy/interceptors/IssuedTokenInterceptorProvider.java

Propchange: cxf/branches/2.4.x-fixes/
------------------------------------------------------------------------------
Binary property 'svnmerge-integrated' - no diff available.

Modified: cxf/branches/2.4.x-fixes/rt/ws/security/src/main/java/org/apache/cxf/ws/security/policy/interceptors/IssuedTokenInterceptorProvider.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.4.x-fixes/rt/ws/security/src/main/java/org/apache/cxf/ws/security/policy/interceptors/IssuedTokenInterceptorProvider.java?rev=1205581&r1=1205580&r2=1205581&view=diff
==============================================================================
--- cxf/branches/2.4.x-fixes/rt/ws/security/src/main/java/org/apache/cxf/ws/security/policy/interceptors/IssuedTokenInterceptorProvider.java
(original)
+++ cxf/branches/2.4.x-fixes/rt/ws/security/src/main/java/org/apache/cxf/ws/security/policy/interceptors/IssuedTokenInterceptorProvider.java
Wed Nov 23 20:49:10 2011
@@ -88,8 +88,7 @@ public class IssuedTokenInterceptorProvi
         this.getInFaultInterceptors().add(new IssuedTokenInInterceptor());
     }
     
-    
-    static final TokenStore getTokenStore(Message message) {
+    static final TokenStore createTokenStore(Message message) {
         EndpointInfo info = message.getExchange().get(Endpoint.class).getEndpointInfo();
         synchronized (info) {
             TokenStore tokenStore = (TokenStore)message.getContextualProperty(TokenStore.class.getName());
@@ -100,8 +99,15 @@ public class IssuedTokenInterceptorProvi
                 tokenStore = new MemoryTokenStore();
                 info.setProperty(TokenStore.class.getName(), tokenStore);
             }
-            return tokenStore;
+            return tokenStore; 
+        }
+    }
+    static final TokenStore getTokenStore(Message message) {
+        TokenStore tokenStore = (TokenStore)message.getContextualProperty(TokenStore.class.getName());
+        if (tokenStore == null) {
+            tokenStore = createTokenStore(message);
         }
+        return tokenStore;
     }
 
     static class IssuedTokenOutInterceptor extends AbstractPhaseInterceptor<Message>
{
@@ -233,6 +239,14 @@ public class IssuedTokenInterceptorProvi
                         tok = getTokenStore(message).getToken(tokId);
                     }
                 }
+            } else {
+                tok = (SecurityToken)message.get(SecurityConstants.TOKEN);
+                if (tok == null) {
+                    String tokId = (String)message.get(SecurityConstants.TOKEN_ID);
+                    if (tokId != null) {
+                        tok = getTokenStore(message).getToken(tokId);
+                    }
+                }
             }
             return tok;
         }



Mime
View raw message