Return-Path: X-Original-To: apmail-cxf-commits-archive@www.apache.org Delivered-To: apmail-cxf-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 5D93F7D4E for ; Tue, 4 Oct 2011 13:09:54 +0000 (UTC) Received: (qmail 48494 invoked by uid 500); 4 Oct 2011 13:09:54 -0000 Delivered-To: apmail-cxf-commits-archive@cxf.apache.org Received: (qmail 48449 invoked by uid 500); 4 Oct 2011 13:09:54 -0000 Mailing-List: contact commits-help@cxf.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@cxf.apache.org Delivered-To: mailing list commits@cxf.apache.org Received: (qmail 48442 invoked by uid 99); 4 Oct 2011 13:09:54 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 04 Oct 2011 13:09:54 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 04 Oct 2011 13:09:51 +0000 Received: from eris.apache.org (localhost [127.0.0.1]) by eris.apache.org (Postfix) with ESMTP id 761AA23888E4 for ; Tue, 4 Oct 2011 13:09:30 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit 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 -0000 To: commits@cxf.apache.org From: sergeyb@apache.org X-Mailer: svnmailer-1.0.8-patched Message-Id: <20111004130930.761AA23888E4@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org 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> 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"); - } - } + }