tuscany-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bdan...@apache.org
Subject svn commit: r1137040 - /tuscany/sca-java-2.x/trunk/modules/builder/src/main/java/org/apache/tuscany/sca/builder/impl/PolicyAppliesToBuilderImpl.java
Date Fri, 17 Jun 2011 21:27:59 GMT
Author: bdaniel
Date: Fri Jun 17 21:27:59 2011
New Revision: 1137040

URL: http://svn.apache.org/viewvc?rev=1137040&view=rev
Log:
Correctly remove policies from endpoints and endpoint references when there are multiple endpoints

Modified:
    tuscany/sca-java-2.x/trunk/modules/builder/src/main/java/org/apache/tuscany/sca/builder/impl/PolicyAppliesToBuilderImpl.java

Modified: tuscany/sca-java-2.x/trunk/modules/builder/src/main/java/org/apache/tuscany/sca/builder/impl/PolicyAppliesToBuilderImpl.java
URL: http://svn.apache.org/viewvc/tuscany/sca-java-2.x/trunk/modules/builder/src/main/java/org/apache/tuscany/sca/builder/impl/PolicyAppliesToBuilderImpl.java?rev=1137040&r1=1137039&r2=1137040&view=diff
==============================================================================
--- tuscany/sca-java-2.x/trunk/modules/builder/src/main/java/org/apache/tuscany/sca/builder/impl/PolicyAppliesToBuilderImpl.java
(original)
+++ tuscany/sca-java-2.x/trunk/modules/builder/src/main/java/org/apache/tuscany/sca/builder/impl/PolicyAppliesToBuilderImpl.java
Fri Jun 17 21:27:59 2011
@@ -101,23 +101,23 @@ public class PolicyAppliesToBuilderImpl 
     	for (Component component : topComposite.getComponents()) {
 
     		for (ComponentService componentService : component.getServices()) {
-    			for (Endpoint ep : componentService.getEndpoints()) {
-    			    List<PolicySet> policySetsToRemove = checkAppliesToSubject(document, appliesToSubjects,
topComposite, (PolicySubject)ep.getService(), ep.getService().getPolicySets());
+    			List<PolicySet> policySetsToRemove = checkAppliesToSubject(document, appliesToSubjects,
topComposite, componentService, componentService.getPolicySets());
+    			for (Endpoint ep : componentService.getEndpoints()) {    			    
     			    ep.getPolicySets().removeAll(policySetsToRemove);
     				if (ep.getBinding() instanceof PolicySubject) {
-    				    policySetsToRemove = checkAppliesToSubject(document, appliesToSubjects, topComposite,
(PolicySubject)ep.getBinding(), ((PolicySubject)ep.getBinding()).getPolicySets());
-    				    ep.getPolicySets().removeAll(policySetsToRemove);
+    				    List<PolicySet> bindingPolicySetsToRemove = checkAppliesToSubject(document,
appliesToSubjects, topComposite, (PolicySubject)ep.getBinding(), ((PolicySubject)ep.getBinding()).getPolicySets());
+    				    ep.getPolicySets().removeAll(bindingPolicySetsToRemove);
     				}
     			}
     		}
 
     		for (ComponentReference componentReference : component.getReferences()) {
-    			for (EndpointReference epr : componentReference.getEndpointReferences()) {
-    			    List<PolicySet> policySetsToRemove = checkAppliesToSubject(document, appliesToSubjects,
topComposite, (PolicySubject)epr.getReference(), epr.getReference().getPolicySets());
+    			List<PolicySet> policySetsToRemove = checkAppliesToSubject(document, appliesToSubjects,
topComposite, componentReference, componentReference.getPolicySets());
+    			for (EndpointReference epr : componentReference.getEndpointReferences()) {    			
   
     			    epr.getPolicySets().removeAll(policySetsToRemove);
     				if (epr.getBinding() instanceof PolicySubject) {
-    				    policySetsToRemove = checkAppliesToSubject(document, appliesToSubjects, topComposite,
(PolicySubject)epr.getBinding(), ((PolicySubject)epr.getBinding()).getPolicySets());
-    				    epr.getPolicySets().removeAll(policySetsToRemove);
+    				    List<PolicySet> bindingPolicySetsToRemove = checkAppliesToSubject(document,
appliesToSubjects, topComposite, (PolicySubject)epr.getBinding(), ((PolicySubject)epr.getBinding()).getPolicySets());
+    				    epr.getPolicySets().removeAll(bindingPolicySetsToRemove);
     				} 
     			}
     		}



Mime
View raw message