cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From owu...@apache.org
Subject svn commit: r1486195 - /cxf/branches/2.7.x-fixes/services/sts/sts-core/src/main/java/org/apache/cxf/sts/claims/ClaimsManager.java
Date Fri, 24 May 2013 19:53:19 GMT
Author: owulff
Date: Fri May 24 19:53:19 2013
New Revision: 1486195

URL: http://svn.apache.org/r1486195
Log:
Allow continue processing ClaimsHandler even exception occured

Modified:
    cxf/branches/2.7.x-fixes/services/sts/sts-core/src/main/java/org/apache/cxf/sts/claims/ClaimsManager.java

Modified: cxf/branches/2.7.x-fixes/services/sts/sts-core/src/main/java/org/apache/cxf/sts/claims/ClaimsManager.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.7.x-fixes/services/sts/sts-core/src/main/java/org/apache/cxf/sts/claims/ClaimsManager.java?rev=1486195&r1=1486194&r2=1486195&view=diff
==============================================================================
--- cxf/branches/2.7.x-fixes/services/sts/sts-core/src/main/java/org/apache/cxf/sts/claims/ClaimsManager.java
(original)
+++ cxf/branches/2.7.x-fixes/services/sts/sts-core/src/main/java/org/apache/cxf/sts/claims/ClaimsManager.java
Fri May 24 19:53:19 2013
@@ -47,6 +47,15 @@ public class ClaimsManager {
     private List<ClaimsParser> claimParsers;
     private List<ClaimsHandler> claimHandlers;
     private List<URI> supportedClaimTypes = new ArrayList<URI>();
+    private boolean stopProcessingOnException = true;
+
+    public boolean isStopProcessingOnException() {
+        return stopProcessingOnException;
+    }
+
+    public void setStopProcessingOnException(boolean stopProcessingOnException) {
+        this.stopProcessingOnException = stopProcessingOnException;
+    }
 
     public List<URI> getSupportedClaimTypes() {
         return supportedClaimTypes;
@@ -127,7 +136,18 @@ public class ClaimsManager {
                     if (supportedClaims.isEmpty()) {
                         continue;
                     }
-                    ClaimCollection claimCollection = handler.retrieveClaimValues(supportedClaims,
parameters);
+                    
+                    ClaimCollection claimCollection = null;
+                    try {
+                        claimCollection = handler.retrieveClaimValues(claims, parameters);
+                    } catch (Exception ex) {
+                        LOG.log(Level.INFO, "Failed retrieving claims from ClaimsHandler
"
+                                + handler.getClass().getName(), ex);
+                        if (this.isStopProcessingOnException()) {
+                            throw ex;
+                        }
+                    }
+                    
                     if (claimCollection != null && claimCollection.size() != 0) {
                         returnCollection.addAll(claimCollection);
                     }



Mime
View raw message