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 di...@apache.org on 2008/04/03 04:30:00 UTC
svn commit: r644136 -
/webservices/sandesha/trunk/java/modules/core/src/main/java/org/apache/sandesha2/util/PropertyManager.java
Author: dims
Date: Wed Apr 2 19:29:59 2008
New Revision: 644136
URL: http://svn.apache.org/viewvc?rev=644136&view=rev
Log:
Fix Build break caused by axis2 changes.
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=644136&r1=644135&r2=644136&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 Wed Apr 2 19:29:59 2008
@@ -22,10 +22,12 @@
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
+import java.util.Collection;
import org.apache.axis2.description.AxisDescription;
import org.apache.axis2.description.AxisModule;
import org.apache.axis2.description.Parameter;
+import org.apache.axis2.description.PolicySubject;
import org.apache.neethi.Assertion;
import org.apache.neethi.Policy;
import org.apache.sandesha2.Sandesha2Constants;
@@ -147,43 +149,46 @@
public static SandeshaPolicyBean loadPropertiesFromModuleDescPolicy(AxisModule desc,
SandeshaPolicyBean parentPropertyBean) throws SandeshaException {
- Policy policy = desc.getPolicyInclude().getEffectivePolicy();
+ boolean found = false;
+ Assertion assertion = null;
- if (policy == null) {
- return null; // no pilicy is available in the module description
- }
-
- Iterator iterator = policy.getAlternatives();
- if (! iterator.hasNext()) {
- throw new SandeshaException("No Policy Alternative found");
+ PolicySubject policySubject = desc.getPolicySubject();
+ if (policySubject == null) {
+ return null;
}
-
- List assertionList = (List) iterator.next();
- Assertion assertion = null;
-
- boolean found = false;
-
- for (Iterator assertions = assertionList.iterator(); assertions.hasNext();) {
- assertion = (Assertion) assertions.next();
-
- if (assertion instanceof SandeshaPolicyBean) {
- found = true;
- break;
+ Collection policyComponents = policySubject.getAttachPolicyComponents();
+ if (policyComponents == null) {
+ return null;
+ }
+ Iterator policies = policyComponents.iterator();
+ while (!found && policies.hasNext()) {
+ Policy policy = (Policy) policies.next();
+ Iterator iterator = policy.getAlternatives();
+ while (!found && iterator.hasNext()) {
+ List assertionList = (List) iterator.next();
+ Iterator assertions = assertionList.iterator();
+ while (!found && assertions.hasNext()) {
+ assertion = (Assertion) assertions.next();
+ if (assertion instanceof SandeshaPolicyBean) {
+ found = true;
+ break;
+ }
+ }
}
}
-
- if (! found) {
- // no RMAssertion found
+
+ // no RMAssertion found
+ if (!found) {
return null;
}
-
+
SandeshaPolicyBean propertyBean = (SandeshaPolicyBean) assertion;
propertyBean.setParent(parentPropertyBean);
- return propertyBean;
- }
+ return propertyBean;
+ }
- public static SandeshaPolicyBean loadPropertiesFromAxisDescription(AxisDescription desc,
+ public static SandeshaPolicyBean loadPropertiesFromAxisDescription(AxisDescription desc,
SandeshaPolicyBean parentPropertyBean) throws SandeshaException {
Policy policy = desc.getPolicyInclude().getEffectivePolicy();
---------------------------------------------------------------------
To unsubscribe, e-mail: sandesha-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: sandesha-dev-help@ws.apache.org