tuscany-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From svkr...@apache.org
Subject svn commit: r573541 - /incubator/tuscany/java/sca/modules/assembly-xml/src/main/java/org/apache/tuscany/sca/assembly/xml/PolicyAttachPointProcessor.java
Date Fri, 07 Sep 2007 11:02:50 GMT
Author: svkrish
Date: Fri Sep  7 04:02:50 2007
New Revision: 573541

URL: http://svn.apache.org/viewvc?rev=573541&view=rev
Log:
fixes to resolve method

Modified:
    incubator/tuscany/java/sca/modules/assembly-xml/src/main/java/org/apache/tuscany/sca/assembly/xml/PolicyAttachPointProcessor.java

Modified: incubator/tuscany/java/sca/modules/assembly-xml/src/main/java/org/apache/tuscany/sca/assembly/xml/PolicyAttachPointProcessor.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/modules/assembly-xml/src/main/java/org/apache/tuscany/sca/assembly/xml/PolicyAttachPointProcessor.java?rev=573541&r1=573540&r2=573541&view=diff
==============================================================================
--- incubator/tuscany/java/sca/modules/assembly-xml/src/main/java/org/apache/tuscany/sca/assembly/xml/PolicyAttachPointProcessor.java
(original)
+++ incubator/tuscany/java/sca/modules/assembly-xml/src/main/java/org/apache/tuscany/sca/assembly/xml/PolicyAttachPointProcessor.java
Fri Sep  7 04:02:50 2007
@@ -216,38 +216,40 @@
         return new XAttr(Constants.POLICY_SETS, qnames);
     }
     
-    private void resolvePolicies(PolicySetAttachPoint policySetAttachPoint, ModelResolver
resolver) {
-        List<Intent> requiredIntents = new ArrayList<Intent>();
-        Intent resolvedIntent = null;
-        
-        if ( policySetAttachPoint instanceof Binding ) {
-            if ( policySetAttachPoint.getType().isUnresolved() ) {
-                IntentAttachPointType resolved = 
-                    resolver.resolveModel(IntentAttachPointType.class, policySetAttachPoint.getType());
-                policySetAttachPoint.setType(resolved);
+    public void resolvePolicies(Object attachPoint, ModelResolver resolver) {
+        if ( attachPoint instanceof PolicySetAttachPoint ) {
+            PolicySetAttachPoint policySetAttachPoint = (PolicySetAttachPoint)attachPoint;
+            
+            List<Intent> requiredIntents = new ArrayList<Intent>();
+            Intent resolvedIntent = null;
+            
+            if ( policySetAttachPoint instanceof Binding ) {
+                if ( policySetAttachPoint.getType().isUnresolved() ) {
+                    IntentAttachPointType resolved = 
+                        resolver.resolveModel(IntentAttachPointType.class, policySetAttachPoint.getType());
+                    policySetAttachPoint.setType(resolved);
+                }
             }
-        }
-        
-        if ( policySetAttachPoint.getRequiredIntents() != null && policySetAttachPoint.getRequiredIntents().size()
> 0 ) {
-            for ( Intent intent : policySetAttachPoint.getRequiredIntents() ) {
-                resolvedIntent = resolver.resolveModel(Intent.class, intent);
-                requiredIntents.add(resolvedIntent);
+            
+            if ( policySetAttachPoint.getRequiredIntents() != null && policySetAttachPoint.getRequiredIntents().size()
> 0 ) {
+                for ( Intent intent : policySetAttachPoint.getRequiredIntents() ) {
+                    resolvedIntent = resolver.resolveModel(Intent.class, intent);
+                    requiredIntents.add(resolvedIntent);
+                }
+                policySetAttachPoint.getRequiredIntents().clear();
+                policySetAttachPoint.getRequiredIntents().addAll(requiredIntents);
             }
-            policySetAttachPoint.getRequiredIntents().clear();
-            policySetAttachPoint.getRequiredIntents().addAll(requiredIntents);
-        }
-        
-        if ( policySetAttachPoint.getPolicySets() != null && policySetAttachPoint.getPolicySets().size()
> 0 ) {
-            List<PolicySet> resolvedPolicySets = new ArrayList<PolicySet>();
-            PolicySet resolvedPolicySet = null;
-            for ( PolicySet policySet : policySetAttachPoint.getPolicySets() ) {
-                resolvedPolicySet = resolver.resolveModel(PolicySet.class, policySet);
-                resolvedPolicySets.add(resolvedPolicySet);
+            
+            if ( policySetAttachPoint.getPolicySets() != null && policySetAttachPoint.getPolicySets().size()
> 0 ) {
+                List<PolicySet> resolvedPolicySets = new ArrayList<PolicySet>();
+                PolicySet resolvedPolicySet = null;
+                for ( PolicySet policySet : policySetAttachPoint.getPolicySets() ) {
+                    resolvedPolicySet = resolver.resolveModel(PolicySet.class, policySet);
+                    resolvedPolicySets.add(resolvedPolicySet);
+                }
+                policySetAttachPoint.getPolicySets().clear();
+                policySetAttachPoint.getPolicySets().addAll(resolvedPolicySets);
             }
-            policySetAttachPoint.getPolicySets().clear();
-            policySetAttachPoint.getPolicySets().addAll(resolvedPolicySets);
         }
     }
-
-
 }



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


Mime
View raw message