cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From serg...@apache.org
Subject svn commit: r1178774 - /cxf/trunk/rt/rs/security/xml/src/main/java/org/apache/cxf/rs/security/saml/authorization/ClaimsAuthorizingFilter.java
Date Tue, 04 Oct 2011 13:09:30 GMT
Author: sergeyb
Date: Tue Oct  4 13:09:30 2011
New Revision: 1178774

URL: http://svn.apache.org/viewvc?rev=1178774&view=rev
Log:
[CXF-3844] Simplifying the interceptor wrapper

Modified:
    cxf/trunk/rt/rs/security/xml/src/main/java/org/apache/cxf/rs/security/saml/authorization/ClaimsAuthorizingFilter.java

Modified: cxf/trunk/rt/rs/security/xml/src/main/java/org/apache/cxf/rs/security/saml/authorization/ClaimsAuthorizingFilter.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/rs/security/xml/src/main/java/org/apache/cxf/rs/security/saml/authorization/ClaimsAuthorizingFilter.java?rev=1178774&r1=1178773&r2=1178774&view=diff
==============================================================================
--- cxf/trunk/rt/rs/security/xml/src/main/java/org/apache/cxf/rs/security/saml/authorization/ClaimsAuthorizingFilter.java
(original)
+++ cxf/trunk/rt/rs/security/xml/src/main/java/org/apache/cxf/rs/security/saml/authorization/ClaimsAuthorizingFilter.java
Tue Oct  4 13:09:30 2011
@@ -30,7 +30,7 @@ import org.apache.cxf.message.Message;
 
 public class ClaimsAuthorizingFilter implements RequestHandler {
 
-    private ClaimsAuthorizingInterceptor interceptor;
+    private ClaimsAuthorizingInterceptor interceptor = new ClaimsAuthorizingInterceptor();
     
     public Response handleRequest(Message m, ClassResourceInfo resourceClass) {
         try {
@@ -42,22 +42,12 @@ public class ClaimsAuthorizingFilter imp
     }
 
     public void setClaims(Map<String, List<ClaimBean>> claimsMap) {
-        checkInterceptor();
-        ClaimsAuthorizingInterceptor simple = new ClaimsAuthorizingInterceptor();
-        simple.setClaims(claimsMap);
-        interceptor = simple; 
+        interceptor.setClaims(claimsMap);
     }
     
     public void setSecuredObject(Object securedObject) {
-        checkInterceptor();
-        ClaimsAuthorizingInterceptor simple = new ClaimsAuthorizingInterceptor();
-        simple.setSecuredObject(securedObject);
-        interceptor = simple; 
+        interceptor.setSecuredObject(securedObject);
     }
     
-    private void checkInterceptor() {
-        if (interceptor != null) {
-            throw new IllegalStateException("Filter has already been initialized");
-        }
-    }
+    
 }



Mime
View raw message