You are viewing a plain text version of this content. The canonical link for it is here.
Posted to sandesha-dev@ws.apache.org by da...@apache.org on 2008/12/09 19:44:10 UTC

svn commit: r724816 - /webservices/sandesha/trunk/java/modules/core/src/main/java/org/apache/sandesha2/util/PropertyManager.java

Author: davidillsley
Date: Tue Dec  9 10:44:09 2008
New Revision: 724816

URL: http://svn.apache.org/viewvc?rev=724816&view=rev
Log:
Match up with the generic type argument added to Axis2 PolicySubject

Modified:
    webservices/sandesha/trunk/java/modules/core/src/main/java/org/apache/sandesha2/util/PropertyManager.java

Modified: webservices/sandesha/trunk/java/modules/core/src/main/java/org/apache/sandesha2/util/PropertyManager.java
URL: http://svn.apache.org/viewvc/webservices/sandesha/trunk/java/modules/core/src/main/java/org/apache/sandesha2/util/PropertyManager.java?rev=724816&r1=724815&r2=724816&view=diff
==============================================================================
--- webservices/sandesha/trunk/java/modules/core/src/main/java/org/apache/sandesha2/util/PropertyManager.java (original)
+++ webservices/sandesha/trunk/java/modules/core/src/main/java/org/apache/sandesha2/util/PropertyManager.java Tue Dec  9 10:44:09 2008
@@ -20,9 +20,9 @@
 package org.apache.sandesha2.util;
 
 import java.util.ArrayList;
+import java.util.Collection;
 import java.util.Iterator;
 import java.util.List;
-import java.util.Collection;
 
 import org.apache.axis2.description.AxisDescription;
 import org.apache.axis2.description.AxisModule;
@@ -30,6 +30,7 @@
 import org.apache.axis2.description.PolicySubject;
 import org.apache.neethi.Assertion;
 import org.apache.neethi.Policy;
+import org.apache.neethi.PolicyComponent;
 import org.apache.sandesha2.Sandesha2Constants;
 import org.apache.sandesha2.SandeshaException;
 import org.apache.sandesha2.i18n.SandeshaMessageHelper;
@@ -156,25 +157,28 @@
         if (policySubject == null) {
             return null;
         }
-        Collection<Policy> policyComponents = policySubject.getAttachedPolicyComponents();
+        Collection<PolicyComponent> policyComponents = policySubject.getAttachedPolicyComponents();
         if (policyComponents == null) {
             return null;
         }
-        Iterator<Policy> policies = policyComponents.iterator();
+        Iterator<PolicyComponent> policies = policyComponents.iterator();
         while (!found && policies.hasNext()) {
-            Policy policy = (Policy) policies.next();
-            Iterator<List<Assertion>> iterator = policy.getAlternatives();
-            while (!found && iterator.hasNext()) {
-                List<Assertion> assertionList = (List<Assertion>) iterator.next();
-                Iterator<Assertion> assertions = assertionList.iterator();
-                while (!found && assertions.hasNext()) {
-                    assertion = (Assertion) assertions.next();
-                    if (assertion instanceof SandeshaPolicyBean) {
-                        found = true;
-                        break;
-                    }
-                }
-            }
+        	Object next = policies.next();
+        	if(next instanceof Policy){
+        		Policy policy = (Policy) next;
+        		Iterator<List<Assertion>> iterator = policy.getAlternatives();
+        		while (!found && iterator.hasNext()) {
+        			List<Assertion> assertionList = (List<Assertion>) iterator.next();
+        			Iterator<Assertion> assertions = assertionList.iterator();
+        			while (!found && assertions.hasNext()) {
+        				assertion = (Assertion) assertions.next();
+        				if (assertion instanceof SandeshaPolicyBean) {
+        					found = true;
+        					break;
+        				}
+        			}
+        		}
+        	}
         }
 
         // no RMAssertion found



---------------------------------------------------------------------
To unsubscribe, e-mail: sandesha-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: sandesha-dev-help@ws.apache.org