tuscany-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rf...@apache.org
Subject svn commit: r746356 [3/8] - in /tuscany/java/sca/modules: assembly-xml/src/main/java/org/apache/tuscany/sca/assembly/xml/ assembly-xml/src/test/java/org/apache/tuscany/sca/assembly/xml/ assembly-xml/src/test/resources/org/apache/tuscany/sca/assembly/xm...
Date Fri, 20 Feb 2009 20:10:44 GMT
Modified: tuscany/java/sca/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/builder/impl/PolicyConfigurationUtil.java
URL: http://svn.apache.org/viewvc/tuscany/java/sca/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/builder/impl/PolicyConfigurationUtil.java?rev=746356&r1=746355&r2=746356&view=diff
==============================================================================
--- tuscany/java/sca/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/builder/impl/PolicyConfigurationUtil.java (original)
+++ tuscany/java/sca/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/builder/impl/PolicyConfigurationUtil.java Fri Feb 20 20:10:37 2009
@@ -30,17 +30,13 @@
 import org.apache.tuscany.sca.assembly.Base;
 import org.apache.tuscany.sca.assembly.Binding;
 import org.apache.tuscany.sca.assembly.Component;
-import org.apache.tuscany.sca.assembly.ConfiguredOperation;
 import org.apache.tuscany.sca.assembly.Contract;
 import org.apache.tuscany.sca.assembly.Implementation;
-import org.apache.tuscany.sca.assembly.OperationsConfigurator;
-import org.apache.tuscany.sca.assembly.Service;
+import org.apache.tuscany.sca.policy.ExtensionType;
 import org.apache.tuscany.sca.policy.Intent;
-import org.apache.tuscany.sca.policy.IntentAttachPoint;
-import org.apache.tuscany.sca.policy.IntentAttachPointType;
+import org.apache.tuscany.sca.policy.IntentMap;
 import org.apache.tuscany.sca.policy.PolicySet;
-import org.apache.tuscany.sca.policy.PolicySetAttachPoint;
-import org.apache.tuscany.sca.policy.QualifiedIntent;
+import org.apache.tuscany.sca.policy.PolicySubject;
 import org.apache.tuscany.sca.policy.util.PolicyComputationUtils;
 import org.apache.tuscany.sca.policy.util.PolicyValidationException;
 import org.apache.tuscany.sca.policy.util.PolicyValidationUtils;
@@ -52,7 +48,7 @@
  */
 abstract class PolicyConfigurationUtil {
     
-    private static List<Intent> computeInheritableIntents(IntentAttachPointType attachPointType, 
+    private static List<Intent> computeInheritableIntents(ExtensionType attachPointType, 
                                                    List<Intent> inheritableIntents) throws PolicyValidationException {
         List<Intent> validInheritableIntents = new ArrayList<Intent>();
         
@@ -63,7 +59,7 @@
         //only add such intents to the attachpoint (binding / implementation)
         for (Intent intent : inheritableIntents) {
             if ( !intent.isUnresolved() ) { 
-                for (QName constrained : intent.getConstrains()) {
+                for (ExtensionType constrained : intent.getConstrainedTypes()) {
                     if ( PolicyValidationUtils.isConstrained(constrained, attachPointType)) {
                         validInheritableIntents.add(intent);
                         break;
@@ -77,7 +73,7 @@
         return validInheritableIntents;
     }
     
-    private static void normalizeIntents(IntentAttachPoint intentAttachPoint) {
+    private static void normalizeIntents(PolicySubject intentAttachPoint) {
         //expand profile intents specified in the attachpoint (binding / implementation)
         PolicyComputationUtils.expandProfileIntents(intentAttachPoint.getRequiredIntents());
 
@@ -86,7 +82,7 @@
         filterDuplicatesAndQualifiableIntents(intentAttachPoint);
     }
     
-    private static void trimInherentlyProvidedIntents(IntentAttachPointType attachPointType, List<Intent>intents) {
+    private static void trimInherentlyProvidedIntents(ExtensionType attachPointType, List<Intent>intents) {
         //exclude intents that are inherently supported by the 
         //attachpoint-type (binding-type  / implementation-type)
         List<Intent> requiredIntents = new ArrayList<Intent>(intents);
@@ -98,97 +94,13 @@
     }
     
     
-    static void computeIntentsForOperations(IntentAttachPoint intentAttachPoint) throws PolicyValidationException {
-        if ( intentAttachPoint instanceof OperationsConfigurator ) {
-            computeIntentsForOperations((OperationsConfigurator)intentAttachPoint, 
-                                        intentAttachPoint, 
-                                        intentAttachPoint.getRequiredIntents());
-        }
-    }
-    
-    private static void computeIntentsForOperations(OperationsConfigurator opConfigurator, 
-                                               IntentAttachPoint intentAttachPoint, 
-                                               List<Intent> parentIntents) throws PolicyValidationException {
-        IntentAttachPointType attachPointType = intentAttachPoint.getType();
-        
-        boolean found = false;
-        for ( ConfiguredOperation confOp : opConfigurator.getConfiguredOperations() ) {
-            //expand profile intents specified on operations
-            PolicyComputationUtils.expandProfileIntents(confOp.getRequiredIntents());
-            
-            //validateIntents(confOp, attachPointType);
-            
-            //add intents specified for parent intent attach point (binding / implementation)
-            //wherever its not overridden in the operation
-            Intent tempIntent = null;
-            List<Intent> attachPointOpIntents = new ArrayList<Intent>();
-            for (Intent anIntent : parentIntents) {
-                found = false;
-            
-                tempIntent = anIntent;
-                while ( tempIntent instanceof QualifiedIntent ) {
-                    tempIntent = ((QualifiedIntent)tempIntent).getQualifiableIntent();
-                }
-                
-                for ( Intent opIntent : confOp.getRequiredIntents() ) {
-                    if ( opIntent.getName().getLocalPart().startsWith(tempIntent.getName().getLocalPart())) {
-                        found = true;
-                        break;
-                    }
-                }
-                
-                if ( !found ) {
-                    boolean conflict = false;
-                    for (Intent excluded : anIntent.getExcludedIntents()) {
-                        if (confOp.getRequiredIntents().contains(excluded)) {
-                            conflict = true;
-                            break;
-                        }
-                    }
-                    if (!conflict) {
-                        attachPointOpIntents.add(anIntent);
-                    }
-                }
-            }
-            
-            confOp.getRequiredIntents().addAll(attachPointOpIntents);
-            
-            //remove duplicates and ...
-            //where qualified form of intent exists retain it and remove the qualifiable intent
-            filterDuplicatesAndQualifiableIntents(confOp);
-            
-            //exclude intents that are inherently supported by the parent
-            //attachpoint-type (binding-type  / implementation-type)
-            if ( attachPointType != null ) {
-                List<Intent> requiredIntents = new ArrayList<Intent>(confOp.getRequiredIntents());
-                for ( Intent intent : requiredIntents ) {
-                    if ( isProvidedInherently(attachPointType, intent) ) {
-                        confOp.getRequiredIntents().remove(intent);
-                    }
-                }
-            }
-        }
-    }
-    
-    private static List<PolicySet> computeInheritablePolicySets(List<PolicySet> inheritablePolicySets,
-                                                           List<PolicySet> applicablePolicySets) 
+    private static List<PolicySet> computeInheritablePolicySets(List<PolicySet> inheritablePolicySets) 
                                                                throws PolicyValidationException {
-        List<PolicySet> validInheritablePolicySets = new ArrayList<PolicySet>();
-        for (PolicySet policySet : inheritablePolicySets) {
-            if ( !policySet.isUnresolved() ) { 
-                if ( applicablePolicySets.contains(policySet) ) {
-                    validInheritablePolicySets.add(policySet);
-                }
-            } else {
-                throw new PolicyValidationException("Policy Set '" + policySet.getName()
-                        + "' is not defined in this domain  ");
-            }
-        }
-        
-        return validInheritablePolicySets;
+        // FIXME:
+        return inheritablePolicySets;
     }
     
-    private static void normalizePolicySets(PolicySetAttachPoint policySetAttachPoint ) {
+    private static void normalizePolicySets(PolicySubject policySetAttachPoint ) {
         //get rid of duplicate entries
         HashMap<QName, PolicySet> policySetTable = new HashMap<QName, PolicySet>();
         for ( PolicySet policySet : policySetAttachPoint.getPolicySets() ) {
@@ -204,64 +116,6 @@
         }
     }
     
-    private static void computePolicySetsForOperations(List<PolicySet> applicablePolicySets,
-                                                  PolicySetAttachPoint policySetAttachPoint) 
-                                                                        throws PolicyValidationException {
-        if ( policySetAttachPoint instanceof OperationsConfigurator ) {
-            computePolicySetsForOperations(applicablePolicySets, 
-                                           (OperationsConfigurator)policySetAttachPoint, 
-                                           policySetAttachPoint);
-        }
-        
-    }
-    
-    private static void computePolicySetsForOperations(List<PolicySet> applicablePolicySets, 
-                                                  OperationsConfigurator opConfigurator,
-                                                  PolicySetAttachPoint policySetAttachPoint) 
-                                                                        throws PolicyValidationException {
-        //String appliesTo = null;
-        //String scdlFragment = "";
-        HashMap<QName, PolicySet> policySetTable = new HashMap<QName, PolicySet>();
-        IntentAttachPointType attachPointType = policySetAttachPoint.getType();
-        
-        for ( ConfiguredOperation confOp : opConfigurator.getConfiguredOperations() ) {
-            //validate policysets specified for the attachPoint
-            for (PolicySet policySet : confOp.getPolicySets()) {
-                if ( !policySet.isUnresolved() ) {
-                    //appliesTo = policySet.getAppliesTo();
-        
-                    //if (!PolicyValidationUtils.isPolicySetApplicable(scdlFragment, appliesTo, attachPointType)) {
-                    if (!applicablePolicySets.contains(policySet)) {
-                        throw new PolicyValidationException("Policy Set '" + policySet.getName() 
-                                + " specified for operation " + confOp.getName()  
-                            + "' does not constrain extension type  "
-                            + attachPointType.getName());
-        
-                    }
-                } else {
-                    throw new PolicyValidationException("Policy Set '" + policySet.getName() 
-                            + " specified for operation " + confOp.getName()  
-                        + "' is not defined in this domain  ");
-                }
-            }
-            
-            //get rid of duplicate entries
-            for ( PolicySet policySet : confOp.getPolicySets() ) {
-                policySetTable.put(policySet.getName(), policySet);
-            }
-        
-            confOp.getPolicySets().clear();
-            confOp.getPolicySets().addAll(policySetTable.values());
-            policySetTable.clear();
-            
-            //expand profile intents
-            for ( PolicySet policySet : confOp.getPolicySets() ) {
-                PolicyComputationUtils.expandProfileIntents(policySet.getProvidedIntents());
-            }
-        }
-    }
-    
-        
     private static void trimProvidedIntents(List<Intent> requiredIntents, List<PolicySet> policySets) {
         for ( PolicySet policySet : policySets ) {
             trimProvidedIntents(requiredIntents, policySet);
@@ -269,8 +123,8 @@
     }
     
     private static void determineApplicableDomainPolicySets(List<PolicySet> applicablePolicySets,
-                                                     PolicySetAttachPoint policySetAttachPoint,
-                                                     IntentAttachPointType intentAttachPointType) {
+                                                     PolicySubject policySetAttachPoint,
+                                                     ExtensionType intentAttachPointType) {
 
         if (policySetAttachPoint.getRequiredIntents().size() > 0) {
 
@@ -308,12 +162,12 @@
         }
     }
     
-    private static boolean isProvidedInherently(IntentAttachPointType attachPointType, Intent intent) {
+    private static boolean isProvidedInherently(ExtensionType attachPointType, Intent intent) {
         return ( attachPointType != null && 
                  (( attachPointType.getAlwaysProvidedIntents() != null &&
                      attachPointType.getAlwaysProvidedIntents().contains(intent) ) || 
-                  ( attachPointType.getMayProvideIntents() != null &&
-                     attachPointType.getMayProvideIntents().contains(intent) )
+                  ( attachPointType.getMayProvidedIntents() != null &&
+                     attachPointType.getMayProvidedIntents().contains(intent) )
                  ) );
      }
     
@@ -324,14 +178,14 @@
             } 
         }
         
-        for ( Intent mappedIntent : policySet.getMappedPolicies().keySet() ) {
-            if ( requiredIntents.contains(mappedIntent) ) {
-                requiredIntents.remove(mappedIntent);
+        for ( IntentMap intentMap : policySet.getIntentMaps() ) {
+            if ( requiredIntents.contains(intentMap.getProvidedIntent()) ) {
+                requiredIntents.remove(intentMap.getProvidedIntent());
             } 
         }
     }
     
-    private static void filterDuplicatesAndQualifiableIntents(IntentAttachPoint intentAttachPoint) {
+    private static void filterDuplicatesAndQualifiableIntents(PolicySubject intentAttachPoint) {
         //remove duplicates
         Map<QName, Intent> intentsTable = new HashMap<QName, Intent>();
         for ( Intent intent : intentAttachPoint.getRequiredIntents() ) {
@@ -342,55 +196,22 @@
         Map<QName, Intent> intentsTableCopy = new HashMap<QName, Intent>(intentsTable);
         //if qualified form of intent exists remove the unqualified form
         for ( Intent intent : intentsTableCopy.values() ) {
-            if ( intent instanceof QualifiedIntent ) {
-                QualifiedIntent qualifiedIntent = (QualifiedIntent)intent;
-                if ( intentsTable.get(qualifiedIntent.getQualifiableIntent().getName()) != null ) {
-                    intentsTable.remove(qualifiedIntent.getQualifiableIntent().getName());
+            if ( intent.getParent()!=null ) {
+                if ( intentsTable.get(intent.getParent().getName()) != null ) {
+                    intentsTable.remove(intent.getParent().getName());
                 }
             }
         }
         intentAttachPoint.getRequiredIntents().clear();
         intentAttachPoint.getRequiredIntents().addAll(intentsTable.values());
     }
-    
-    private static void validateIntents(ConfiguredOperation confOp, IntentAttachPointType attachPointType) throws PolicyValidationException {
-        boolean found = false;
-        if ( attachPointType != null ) {
-            //validate intents specified against the parent (binding / implementation)
-            found = false;
-            for (Intent intent : confOp.getRequiredIntents()) {
-                if ( !intent.isUnresolved() ) {
-                    for (QName constrained : intent.getConstrains()) {
-                        if (PolicyValidationUtils.isConstrained(constrained, attachPointType)) {
-                            found = true;
-                            break;
-                        }
-                    }
-        
-                    if (!found) {
-                        throw new PolicyValidationException("Policy Intent '" + intent.getName() 
-                                + " specified for operation " + confOp.getName()  
-                            + "' does not constrain extension type  "
-                            + attachPointType.getName());
-                    }
-                } else {
-                    throw new PolicyValidationException("Policy Intent '" + intent.getName() 
-                            + " specified for operation " + confOp.getName()  
-                        + "' is not defined in this domain  ");
-                }
-            }
-        }
-    }
 
     static void computeBindingIntentsAndPolicySets(Contract contract)  throws PolicyValidationException {
         for (Binding binding : contract.getBindings()) {
-            if (binding instanceof PolicySetAttachPoint) {
-                PolicySetAttachPoint policiedBinding = (PolicySetAttachPoint)binding;
-                computeIntents((IntentAttachPoint)binding, contract.getRequiredIntents());
+            if (binding instanceof PolicySubject) {
+                PolicySubject policiedBinding = (PolicySubject)binding;
+                computeIntents((PolicySubject)binding, contract.getRequiredIntents());
                 
-                aggregateAndPruneApplicablePolicySets(contract.getApplicablePolicySets(), 
-                                                      policiedBinding.getApplicablePolicySets());
-    
                 computePolicySets(policiedBinding, contract.getPolicySets());
     
                 PolicyComputationUtils.checkForMutuallyExclusiveIntents(
@@ -398,39 +219,15 @@
                     policiedBinding.getPolicySets(),
                     policiedBinding.getType(),
                     contract.getName());
-    
-                if ( binding instanceof OperationsConfigurator && 
-                        contract instanceof OperationsConfigurator ) {
-                    //add or merge service operations to the binding
-                    addInheritedOpConfOnBindings((OperationsConfigurator)contract,
-                                                 (OperationsConfigurator)binding,
-                                                 (PolicySetAttachPoint)binding);
-                
-                    computeIntentsForOperations((IntentAttachPoint)binding);
-                    computePolicySetsForOperations(contract.getApplicablePolicySets(), 
-                                                   policiedBinding);
-    
-                    for ( ConfiguredOperation confOp : ((OperationsConfigurator)binding).getConfiguredOperations() ) {
-                        PolicyComputationUtils.checkForMutuallyExclusiveIntents(
-                            confOp.getRequiredIntents(),
-                            confOp.getPolicySets(),
-                            policiedBinding.getType(),
-                            contract.getName() + "." + confOp.getName());
-                    }
-    
-                }
             }
         }
         
         if ( contract.getCallback() != null ) {
             for (Binding binding : contract.getCallback().getBindings()) {
-                if (binding instanceof PolicySetAttachPoint) {
-                    PolicySetAttachPoint policiedBinding = (PolicySetAttachPoint)binding;
-                    computeIntents((IntentAttachPoint)binding, contract.getCallback().getRequiredIntents());
+                if (binding instanceof PolicySubject) {
+                    PolicySubject policiedBinding = (PolicySubject)binding;
+                    computeIntents((PolicySubject)binding, contract.getCallback().getRequiredIntents());
             
-                    aggregateAndPruneApplicablePolicySets(contract.getApplicablePolicySets(), 
-                                                          policiedBinding.getApplicablePolicySets());
-    
                     computePolicySets(policiedBinding, contract.getCallback().getPolicySets());
     
                     PolicyComputationUtils.checkForMutuallyExclusiveIntents(
@@ -444,7 +241,7 @@
         }
     }
 
-    private static void computeIntents(IntentAttachPoint policiedBinding, List<Intent> inheritedIntents) 
+    private static void computeIntents(PolicySubject policiedBinding, List<Intent> inheritedIntents) 
                                                                     throws PolicyValidationException {
             //since the parent component could also contain intents that apply to implementation
             //and binding elements within, we filter out only those that apply to this binding type
@@ -455,11 +252,10 @@
             normalizeIntents(policiedBinding);
     }
 
-    private static void computePolicySets(PolicySetAttachPoint policiedBinding,
+    private static void computePolicySets(PolicySubject policiedBinding,
                                    List<PolicySet> inheritedPolicySets) throws PolicyValidationException {
                 
-        List<PolicySet> prunedPolicySets = computeInheritablePolicySets(inheritedPolicySets,
-                                                                        policiedBinding.getApplicablePolicySets());
+        List<PolicySet> prunedPolicySets = computeInheritablePolicySets(inheritedPolicySets);
         policiedBinding.getPolicySets().addAll(prunedPolicySets);
         normalizePolicySets(policiedBinding);
     }
@@ -467,9 +263,9 @@
     static void determineApplicableBindingPolicySets(Contract source, Contract target) throws PolicyConfigurationException {
         List<Intent> intentsCopy = null;
         for (Binding aBinding : source.getBindings()) {
-            if (aBinding instanceof PolicySetAttachPoint) {
-                PolicySetAttachPoint policiedBinding = (PolicySetAttachPoint)aBinding;
-                IntentAttachPointType bindingType = policiedBinding.getType();
+            if (aBinding instanceof PolicySubject) {
+                PolicySubject policiedBinding = (PolicySubject)aBinding;
+                ExtensionType bindingType = policiedBinding.getType();
     
                 
                 intentsCopy = new ArrayList<Intent>(policiedBinding.getRequiredIntents());
@@ -477,11 +273,11 @@
                 if (target != null) {
                     for (Intent intent : target.getRequiredIntents()) {
                         if (!policiedBinding.getRequiredIntents().contains(intent)) {
-                            for (QName constrained : intent.getConstrains()) {
-                                if (bindingType != null && bindingType.getName().getNamespaceURI()
-                                    .equals(constrained.getNamespaceURI())
-                                    && bindingType.getName().getLocalPart().startsWith(constrained
-                                        .getLocalPart())) {
+                            for (ExtensionType constrained : intent.getConstrainedTypes()) {
+                                if (bindingType != null && bindingType.getType().getNamespaceURI()
+                                    .equals(constrained.getType().getNamespaceURI())
+                                    && bindingType.getType().getLocalPart().startsWith(constrained
+                                        .getType().getLocalPart())) {
                                     policiedBinding.getRequiredIntents().add(intent);
                                     break;
                                 }
@@ -489,37 +285,6 @@
                         }
                     }
                 }
-                
-                //trim intents specified in operations.  First check for policysets specified on the operation
-                //and then in the parent implementation
-                if ( aBinding instanceof OperationsConfigurator ) {
-                    OperationsConfigurator opConfigurator = (OperationsConfigurator)aBinding;
-                    
-                    for ( ConfiguredOperation confOp : opConfigurator.getConfiguredOperations() ) {
-                        List<Intent> opsIntentsCopy = new ArrayList<Intent>(confOp.getRequiredIntents());
-                        
-                        trimInherentlyProvidedIntents(policiedBinding.getType(), 
-                                                      confOp.getRequiredIntents());
-                        trimProvidedIntents(confOp.getRequiredIntents(), confOp.getPolicySets());
-                        trimProvidedIntents(confOp.getRequiredIntents(), policiedBinding.getPolicySets());
-                        
-                        determineApplicableDomainPolicySets(policiedBinding.getApplicablePolicySets(), 
-                                                            confOp,
-                                                            policiedBinding.getType());
-    
-                        if (confOp.getRequiredIntents().size() > 0) {
-                            throw new PolicyConfigurationException("The following are unfulfilled intents for operations configured in "
-                                    + "binding - " + aBinding.getName() + "\nUnfulfilled Intents = " +
-                                    confOp.getRequiredIntents());
-                        }
-                        
-                        //the intents list could have been trimmed when matching for policysets
-                        //since the bindings may need the original set of intents we copy that back
-                        confOp.getRequiredIntents().clear();
-                        confOp.getRequiredIntents().addAll(opsIntentsCopy);
-                        
-                    }
-                }
     
                 trimInherentlyProvidedIntents(policiedBinding.getType(), 
                                               policiedBinding.getRequiredIntents());
@@ -544,8 +309,10 @@
     }
 
     private static void determineApplicableDomainPolicySets(Contract contract, 
-                                                     PolicySetAttachPoint policiedBinding) 
+                                                     PolicySubject policiedBinding) 
                                                             throws PolicyConfigurationException {
+        // FIXME:
+        /*
         //if ( domainPolicySets != null) {
             determineApplicableDomainPolicySets(policiedBinding.getApplicablePolicySets(), 
                                                 policiedBinding,
@@ -563,38 +330,7 @@
                 }
             }
         //}
-    }
-
-    private static void addInheritedOpConfOnBindings(OperationsConfigurator source, 
-                                              OperationsConfigurator target,
-                                              PolicySetAttachPoint attachPoint) throws PolicyValidationException {
-        boolean found = false;
-        
-        List<ConfiguredOperation> additionalOperations = new ArrayList<ConfiguredOperation>();
-        for ( ConfiguredOperation sourceConfOp : source.getConfiguredOperations() ) {
-            for ( ConfiguredOperation targetConfOp : target.getConfiguredOperations() ) {
-                if ( sourceConfOp.getName().equals(targetConfOp.getName())) {
-                    List<Intent> prunedIntents = computeInheritableIntents(attachPoint.getType(), 
-                                                                           sourceConfOp.getRequiredIntents());
-                    PolicyComputationUtils.addInheritedIntents(prunedIntents, 
-                                                               targetConfOp.getRequiredIntents());
-                    
-                    List<PolicySet> prunedPolicySets  = computeInheritablePolicySets(sourceConfOp.getPolicySets(), 
-                                                                                     attachPoint.getApplicablePolicySets());
-                    PolicyComputationUtils.addInheritedPolicySets(prunedPolicySets, targetConfOp.getPolicySets(), true);
-                    found = true;
-                    break;
-                }
-            }
-            
-            if ( !found ) {
-                additionalOperations.add(sourceConfOp);
-            }
-        }
-        
-        if ( !additionalOperations.isEmpty() ) {
-            target.getConfiguredOperations().addAll(additionalOperations);
-        }
+         */
     }
 
     private static void aggregateAndPruneApplicablePolicySets(List<PolicySet> source, List<PolicySet> target) {
@@ -614,23 +350,14 @@
         for (Contract contract : contracts) {
     
             // The contract inherits default policies from the parent composite/component.
-            if ( parent instanceof PolicySetAttachPoint )  {
+            if ( parent instanceof PolicySubject )  {
                 PolicyComputationUtils.addDefaultPolicies(
-                                         ((PolicySetAttachPoint)parent).getRequiredIntents(),
-                                         ((PolicySetAttachPoint)parent).getPolicySets(),
+                                         ((PolicySubject)parent).getRequiredIntents(),
+                                         ((PolicySubject)parent).getPolicySets(),
                                          contract.getRequiredIntents(),
                                          contract.getPolicySets());
             }
     
-            // The contract's configured operations inherit default policies from the contract.
-            for ( ConfiguredOperation confOp : contract.getConfiguredOperations() ) {
-                PolicyComputationUtils.addDefaultPolicies(
-                                         contract.getRequiredIntents(),
-                                         contract.getPolicySets(),
-                                         confOp.getRequiredIntents(),
-                                         confOp.getPolicySets());
-            }
-    
             // The contract's callback inherits default policies from the contract.
             if (contract.getCallback() != null) {
                 PolicyComputationUtils.addDefaultPolicies(
@@ -645,8 +372,8 @@
 
     static void computeImplementationIntentsAndPolicySets(Implementation implementation, Component parent)  
                                                                 throws PolicyValidationException, PolicyConfigurationException {
-        if ( implementation instanceof PolicySetAttachPoint ) {
-            PolicySetAttachPoint policiedImplementation = (PolicySetAttachPoint)implementation;
+        if ( implementation instanceof PolicySubject ) {
+            PolicySubject policiedImplementation = (PolicySubject)implementation;
             //since for an implementation the component has its policy intents and policysets its possible
             //that there are some intents there that does not constrain the implementation.. so prune 
             List<Intent> prunedIntents = computeInheritableIntents(policiedImplementation.getType(), 
@@ -655,13 +382,7 @@
             parent.getRequiredIntents().addAll(prunedIntents);
             normalizeIntents(parent);
     
-            computeIntentsForOperations((OperationsConfigurator)parent,
-                                        (IntentAttachPoint)implementation,
-                                        parent.getRequiredIntents());
-            
-            
-            List<PolicySet> prunedPolicySets = computeInheritablePolicySets(parent.getPolicySets(),
-                                                                            parent.getApplicablePolicySets());
+            List<PolicySet> prunedPolicySets = computeInheritablePolicySets(parent.getPolicySets());
             parent.getPolicySets().clear();
             parent.getPolicySets().addAll(prunedPolicySets);
             normalizePolicySets(parent);
@@ -672,18 +393,6 @@
                 policiedImplementation.getType(),
                 parent.getName());
     
-            computePolicySetsForOperations(parent.getApplicablePolicySets(), 
-                                           (OperationsConfigurator)parent, 
-                                           (PolicySetAttachPoint)implementation);
-    
-            for ( ConfiguredOperation confOp : ((OperationsConfigurator)parent).getConfiguredOperations() ) {
-                PolicyComputationUtils.checkForMutuallyExclusiveIntents(
-                    confOp.getRequiredIntents(),
-                    confOp.getPolicySets(),
-                    policiedImplementation.getType(),
-                    parent.getName() + "." + confOp.getName());
-            }
-            
             determineApplicableImplementationPolicySets(parent);
     
         }
@@ -691,37 +400,8 @@
 
     private static void determineApplicableImplementationPolicySets(Component component) throws PolicyConfigurationException {
         List<Intent> intentsCopy = null;
-        if ( component.getImplementation() instanceof PolicySetAttachPoint ) {
-            PolicySetAttachPoint policiedImplementation = (PolicySetAttachPoint)component.getImplementation();
-           
-            //trim intents specified in operations.  First check for policysets specified on the operation
-            //and then in the parent implementation
-            if ( component instanceof OperationsConfigurator ) {
-                OperationsConfigurator opConfigurator = (OperationsConfigurator)component;
-                
-                for ( ConfiguredOperation confOp : opConfigurator.getConfiguredOperations() ) {
-                    intentsCopy = new ArrayList<Intent>(confOp.getRequiredIntents());
-                    trimInherentlyProvidedIntents(policiedImplementation.getType(), 
-                                                  confOp.getRequiredIntents());
-                    trimProvidedIntents(confOp.getRequiredIntents(), confOp.getPolicySets());
-                    trimProvidedIntents(confOp.getRequiredIntents(), component.getPolicySets());
-                    
-                    determineApplicableDomainPolicySets(component.getApplicablePolicySets(), 
-                                                        confOp,
-                                                        policiedImplementation.getType());
-    
-                    if (confOp.getRequiredIntents().size() > 0) {
-                        throw new PolicyConfigurationException("The following are unfulfilled intents for operations configured in "
-                                + "component implementation - " + component.getName() + "\nUnfulfilled Intents = " +
-                                confOp.getRequiredIntents());
-                    }
-                    
-                    //the intents list could have been trimmed when matching for policysets
-                    //since the implementation may need the original set of intents we copy that back
-                    confOp.getRequiredIntents().clear();
-                    confOp.getRequiredIntents().addAll(intentsCopy);
-                }
-            }
+        if ( component.getImplementation() instanceof PolicySubject ) {
+            PolicySubject policiedImplementation = (PolicySubject)component.getImplementation();
                 
             intentsCopy = new ArrayList<Intent>(component.getRequiredIntents());
             trimInherentlyProvidedIntents(policiedImplementation.getType(), 
@@ -733,9 +413,6 @@
             //TODO: resolved to domain policy registry and attach suitable policy sets to the implementation
             //...for now using the SCA Definitions instead of registry
             //if ( domainPolicySets != null)  {
-                determineApplicableDomainPolicySets(component.getApplicablePolicySets(), 
-                                                    component,
-                                                    policiedImplementation.getType());
                                                     
                 if (component.getRequiredIntents().size() > 0) {
                     throw new PolicyConfigurationException("The following are unfulfilled intents for component implementation - " + component

Modified: tuscany/java/sca/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/impl/AbstractPropertyImpl.java
URL: http://svn.apache.org/viewvc/tuscany/java/sca/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/impl/AbstractPropertyImpl.java?rev=746356&r1=746355&r2=746356&view=diff
==============================================================================
--- tuscany/java/sca/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/impl/AbstractPropertyImpl.java (original)
+++ tuscany/java/sca/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/impl/AbstractPropertyImpl.java Fri Feb 20 20:10:37 2009
@@ -19,14 +19,9 @@
 
 package org.apache.tuscany.sca.assembly.impl;
 
-import java.util.ArrayList;
-import java.util.List;
-
 import javax.xml.namespace.QName;
 
 import org.apache.tuscany.sca.assembly.AbstractProperty;
-import org.apache.tuscany.sca.policy.Intent;
-import org.apache.tuscany.sca.policy.IntentAttachPointType;
 
 /**
  * Represents an abstract property.
@@ -40,12 +35,6 @@
     private QName xsdElement;
     private boolean many;
     private boolean mustSupply;
-    private List<Intent> requiredIntents = new ArrayList<Intent>();
-    
-
-    public List<Intent> getRequiredIntents() {
-        return requiredIntents;
-    }
 
     /**
      * Constructs a new abstract property.
@@ -101,14 +90,4 @@
         this.xsdType = type;
     }
 
-    public IntentAttachPointType getType() {
-        return null;
-    }
-
-    public void setType(IntentAttachPointType type) {
-    }
-    
-    public void setRequiredIntents(List<Intent> intents) {
-        this.requiredIntents = intents;
-    }
 }

Modified: tuscany/java/sca/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/impl/AssemblyFactoryImpl.java
URL: http://svn.apache.org/viewvc/tuscany/java/sca/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/impl/AssemblyFactoryImpl.java?rev=746356&r1=746355&r2=746356&view=diff
==============================================================================
--- tuscany/java/sca/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/impl/AssemblyFactoryImpl.java (original)
+++ tuscany/java/sca/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/impl/AssemblyFactoryImpl.java Fri Feb 20 20:10:37 2009
@@ -32,7 +32,6 @@
 import org.apache.tuscany.sca.assembly.Composite;
 import org.apache.tuscany.sca.assembly.CompositeReference;
 import org.apache.tuscany.sca.assembly.CompositeService;
-import org.apache.tuscany.sca.assembly.ConfiguredOperation;
 import org.apache.tuscany.sca.assembly.ConstrainingType;
 import org.apache.tuscany.sca.assembly.Property;
 import org.apache.tuscany.sca.assembly.Reference;
@@ -113,9 +112,5 @@
     public Wire createWire() {
         return new WireImpl();
     }
-
-    public ConfiguredOperation createConfiguredOperation() {
-        return new ConfiguredOperationImpl();
-    }
-    
+   
 }

Added: tuscany/java/sca/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/impl/BindingImpl.java
URL: http://svn.apache.org/viewvc/tuscany/java/sca/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/impl/BindingImpl.java?rev=746356&view=auto
==============================================================================
--- tuscany/java/sca/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/impl/BindingImpl.java (added)
+++ tuscany/java/sca/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/impl/BindingImpl.java Fri Feb 20 20:10:37 2009
@@ -0,0 +1,77 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ * 
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.    
+ */
+
+package org.apache.tuscany.sca.assembly.impl;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.apache.tuscany.sca.assembly.Binding;
+import org.apache.tuscany.sca.policy.ExtensionType;
+import org.apache.tuscany.sca.policy.Intent;
+import org.apache.tuscany.sca.policy.PolicySet;
+
+/**
+ * 
+ */
+public abstract class BindingImpl extends ExtensibleImpl implements Binding {
+    private String name;
+    private ExtensionType type;
+    private String uri;
+    private List<Intent> requiredIntents = new ArrayList<Intent>();
+    private List<PolicySet> policySets = new ArrayList<PolicySet>();
+
+    public List<Intent> getRequiredIntents() {
+        return requiredIntents;
+    }
+
+    public List<PolicySet> getPolicySets() {
+        return policySets;
+    }
+
+    @Override
+    public Object clone() throws CloneNotSupportedException {
+        return super.clone();
+    }
+
+    public String getName() {
+        return name;
+    }
+
+    public void setName(String name) {
+        this.name = name;
+    }
+
+    public ExtensionType getType() {
+        return type;
+    }
+
+    public void setType(ExtensionType type) {
+        this.type = type;
+    }
+
+    public String getURI() {
+        return uri;
+    }
+
+    public void setURI(String uri) {
+        this.uri = uri;
+    }
+
+}

Propchange: tuscany/java/sca/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/impl/BindingImpl.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: tuscany/java/sca/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/impl/BindingImpl.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Modified: tuscany/java/sca/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/impl/CallbackImpl.java
URL: http://svn.apache.org/viewvc/tuscany/java/sca/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/impl/CallbackImpl.java?rev=746356&r1=746355&r2=746356&view=diff
==============================================================================
--- tuscany/java/sca/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/impl/CallbackImpl.java (original)
+++ tuscany/java/sca/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/impl/CallbackImpl.java Fri Feb 20 20:10:37 2009
@@ -24,9 +24,8 @@
 
 import org.apache.tuscany.sca.assembly.Binding;
 import org.apache.tuscany.sca.assembly.Callback;
-import org.apache.tuscany.sca.assembly.ConfiguredOperation;
+import org.apache.tuscany.sca.policy.ExtensionType;
 import org.apache.tuscany.sca.policy.Intent;
-import org.apache.tuscany.sca.policy.IntentAttachPointType;
 import org.apache.tuscany.sca.policy.PolicySet;
 
 /**
@@ -38,8 +37,6 @@
     private List<Binding> bindings = new ArrayList<Binding>();
     private List<Intent> requiredIntents = new ArrayList<Intent>();
     private List<PolicySet> policySets = new ArrayList<PolicySet>();
-    private List<ConfiguredOperation>  configuredOperations = new ArrayList<ConfiguredOperation>();
-    private List<PolicySet> applicablePolicySets = new ArrayList<PolicySet>(); 
 
     public List<PolicySet> getPolicySets() {
         return policySets;
@@ -56,27 +53,15 @@
         return bindings;
     }
     
-    public IntentAttachPointType getType() {
+    public ExtensionType getType() {
         return null;
     }
 
-    public void setType(IntentAttachPointType type) {
+    public void setType(ExtensionType type) {
     }
     
-    public void setPolicySets(List<PolicySet> policySets) {
-        this.policySets = policySets; 
-    }
-
     public void setRequiredIntents(List<Intent> intents) {
         this.requiredIntents = intents;
     }
     
-    public List<ConfiguredOperation> getConfiguredOperations() {
-        return configuredOperations;
-    }
-
-    public List<PolicySet> getApplicablePolicySets() {
-        return applicablePolicySets;
-    }
-
 }

Modified: tuscany/java/sca/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/impl/ComponentImpl.java
URL: http://svn.apache.org/viewvc/tuscany/java/sca/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/impl/ComponentImpl.java?rev=746356&r1=746355&r2=746356&view=diff
==============================================================================
--- tuscany/java/sca/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/impl/ComponentImpl.java (original)
+++ tuscany/java/sca/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/impl/ComponentImpl.java Fri Feb 20 20:10:37 2009
@@ -25,12 +25,10 @@
 import org.apache.tuscany.sca.assembly.ComponentProperty;
 import org.apache.tuscany.sca.assembly.ComponentReference;
 import org.apache.tuscany.sca.assembly.ComponentService;
-import org.apache.tuscany.sca.assembly.ConfiguredOperation;
 import org.apache.tuscany.sca.assembly.ConstrainingType;
 import org.apache.tuscany.sca.assembly.Implementation;
-import org.apache.tuscany.sca.assembly.OperationsConfigurator;
+import org.apache.tuscany.sca.policy.ExtensionType;
 import org.apache.tuscany.sca.policy.Intent;
-import org.apache.tuscany.sca.policy.IntentAttachPointType;
 import org.apache.tuscany.sca.policy.PolicySet;
 
 /**
@@ -38,7 +36,7 @@
  * 
  * @version $Rev$ $Date$
  */
-public class ComponentImpl extends ExtensibleImpl implements Component, Cloneable, OperationsConfigurator {
+public class ComponentImpl extends ExtensibleImpl implements Component, Cloneable {
     private ConstrainingType constrainingType;
     private Implementation implementation;
     private String name;
@@ -49,9 +47,7 @@
     private List<Intent> requiredIntents = new ArrayList<Intent>();
     private List<PolicySet> policySets = new ArrayList<PolicySet>();
     private Boolean autowire;
-    private IntentAttachPointType type;
-    private List<ConfiguredOperation>  configuredImplOperations = new ArrayList<ConfiguredOperation>();
-    private List<PolicySet> applicablePolicySets = new ArrayList<PolicySet>();
+    private ExtensionType type;
     /**
      * Constructs a new component.
      */
@@ -141,34 +137,12 @@
         return autowire;
     }
 
-    public IntentAttachPointType getType() {
+    public ExtensionType getType() {
         return type;
     }
 
-    public void setType(IntentAttachPointType type) {
+    public void setType(ExtensionType type) {
         this.type = type;
     }
 
-    public void setPolicySets(List<PolicySet> policySets) {
-        this.policySets = policySets;
-        
-    }
-
-    public void setRequiredIntents(List<Intent> intents) {
-        this.requiredIntents = intents;
-        
-    }
-    
-    public List<ConfiguredOperation> getConfiguredOperations() {
-        return configuredImplOperations;
-    }
-
-    public void setConfiguredOperations(List<ConfiguredOperation> configuredOperations) {
-        this.configuredImplOperations = configuredOperations;
-    }
-    
-    public List<PolicySet> getApplicablePolicySets() {
-        return applicablePolicySets;
-    }
-
 }

Modified: tuscany/java/sca/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/impl/ComponentTypeImpl.java
URL: http://svn.apache.org/viewvc/tuscany/java/sca/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/impl/ComponentTypeImpl.java?rev=746356&r1=746355&r2=746356&view=diff
==============================================================================
--- tuscany/java/sca/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/impl/ComponentTypeImpl.java (original)
+++ tuscany/java/sca/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/impl/ComponentTypeImpl.java Fri Feb 20 20:10:37 2009
@@ -26,6 +26,9 @@
 import org.apache.tuscany.sca.assembly.Property;
 import org.apache.tuscany.sca.assembly.Reference;
 import org.apache.tuscany.sca.assembly.Service;
+import org.apache.tuscany.sca.policy.ExtensionType;
+import org.apache.tuscany.sca.policy.Intent;
+import org.apache.tuscany.sca.policy.PolicySet;
 
 /** 
  * Represents a component type.
@@ -38,6 +41,8 @@
     private List<Property> properties = new ArrayList<Property>();
     private List<Reference> references = new ArrayList<Reference>();
     private List<Service> services = new ArrayList<Service>();
+    private List<Intent> requiredIntents = new ArrayList<Intent>();
+    private List<PolicySet> policySets = new ArrayList<PolicySet>();
     /**
      * Constructs a new component type.
      */
@@ -112,4 +117,19 @@
             }
         }
     }
+
+    public List<Intent> getRequiredIntents() {
+        return requiredIntents;
+    }
+
+    public List<PolicySet> getPolicySets() {
+        return policySets;
+    }
+
+    public ExtensionType getType() {
+        return null;
+    }
+
+    public void setType(ExtensionType type) {
+    }
 }

Modified: tuscany/java/sca/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/impl/ConstrainingTypeImpl.java
URL: http://svn.apache.org/viewvc/tuscany/java/sca/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/impl/ConstrainingTypeImpl.java?rev=746356&r1=746355&r2=746356&view=diff
==============================================================================
--- tuscany/java/sca/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/impl/ConstrainingTypeImpl.java (original)
+++ tuscany/java/sca/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/impl/ConstrainingTypeImpl.java Fri Feb 20 20:10:37 2009
@@ -27,8 +27,9 @@
 import org.apache.tuscany.sca.assembly.AbstractReference;
 import org.apache.tuscany.sca.assembly.AbstractService;
 import org.apache.tuscany.sca.assembly.ConstrainingType;
+import org.apache.tuscany.sca.policy.ExtensionType;
 import org.apache.tuscany.sca.policy.Intent;
-import org.apache.tuscany.sca.policy.IntentAttachPointType;
+import org.apache.tuscany.sca.policy.PolicySet;
 
 /**
  * Represents a constraining type.
@@ -41,6 +42,7 @@
     private List<AbstractReference> references = new ArrayList<AbstractReference>();
     private List<AbstractService> services = new ArrayList<AbstractService>();
     private List<Intent> requiredIntents = new ArrayList<Intent>();
+    private List<PolicySet> policySets = new ArrayList<PolicySet>();
     
     /**
      * Constructs a new ConstrainingType
@@ -71,6 +73,10 @@
     public List<Intent> getRequiredIntents() {
         return requiredIntents;
     }
+    
+    public List<PolicySet> getPolicySets() {
+        return policySets;
+    }
 
     @Override
     public int hashCode() {
@@ -92,14 +98,11 @@
         }
     }
     
-    public IntentAttachPointType getType() {
+    public ExtensionType getType() {
         return null;
     }
 
-    public void setType(IntentAttachPointType type) {
+    public void setType(ExtensionType type) {
     }
     
-    public void setRequiredIntents(List<Intent> intents) {
-        this.requiredIntents = intents;
-    }
 }

Modified: tuscany/java/sca/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/impl/ContractImpl.java
URL: http://svn.apache.org/viewvc/tuscany/java/sca/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/impl/ContractImpl.java?rev=746356&r1=746355&r2=746356&view=diff
==============================================================================
--- tuscany/java/sca/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/impl/ContractImpl.java (original)
+++ tuscany/java/sca/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/impl/ContractImpl.java Fri Feb 20 20:10:37 2009
@@ -22,10 +22,10 @@
 import java.util.List;
 
 import org.apache.tuscany.sca.assembly.AbstractContract;
-import org.apache.tuscany.sca.assembly.ConfiguredOperation;
 import org.apache.tuscany.sca.interfacedef.InterfaceContract;
+import org.apache.tuscany.sca.policy.ExtensionType;
 import org.apache.tuscany.sca.policy.Intent;
-import org.apache.tuscany.sca.policy.IntentAttachPointType;
+import org.apache.tuscany.sca.policy.PolicySet;
 
 /**
  * Implementation of a Contract.
@@ -36,7 +36,7 @@
     private InterfaceContract interfaceContract;
     private String name;
     private List<Intent> requiredIntents = new ArrayList<Intent>();
-    private List<ConfiguredOperation>  configuredOperations = new ArrayList<ConfiguredOperation>();
+    private List<PolicySet> policySets = new ArrayList<PolicySet>();
     
     private boolean isCallback = false;
     
@@ -74,23 +74,15 @@
         this.isCallback = isCallback;
     }
 
-    public IntentAttachPointType getType() {
+    public ExtensionType getType() {
         return null;
     }
 
-    public void setType(IntentAttachPointType type) {
+    public void setType(ExtensionType type) {
     }
-    
-    public void setRequiredIntents(List<Intent> intents) {
-        this.requiredIntents = intents;
-    }
-    
-    public List<ConfiguredOperation> getConfiguredOperations() {
-        return configuredOperations;
-    }
-
-    public void setConfiguredOperations(List<ConfiguredOperation> configuredOperations) {
-        this.configuredOperations = configuredOperations;
+   
+    public List<PolicySet> getPolicySets() {
+        return policySets;
     }
 
 }

Modified: tuscany/java/sca/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/impl/ExtensionImpl.java
URL: http://svn.apache.org/viewvc/tuscany/java/sca/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/impl/ExtensionImpl.java?rev=746356&r1=746355&r2=746356&view=diff
==============================================================================
--- tuscany/java/sca/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/impl/ExtensionImpl.java (original)
+++ tuscany/java/sca/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/impl/ExtensionImpl.java Fri Feb 20 20:10:37 2009
@@ -23,41 +23,40 @@
 import org.apache.tuscany.sca.assembly.Extension;
 
 public class ExtensionImpl implements Extension {
-	private QName qName;
-	private Object value;
-	boolean isAttribute = false;
-
-	public ExtensionImpl() {
-		
-	}
-	
-	public ExtensionImpl(QName qName, Object value, boolean isAttribute) {
-		this.qName = qName;
-		this.value = value;
-		this.isAttribute = isAttribute;
-	}
-	
-	public QName getQName() {
-		return qName;
-	}
-
-	public void setQName(QName qName) {
-		this.qName = qName;
-	}
-
-	public Object getValue() {
-		return value;
-	}
-
-	public void setValue(Object value) {
-		this.value = value;
-	}
-
-	public boolean isAttribute() {
-		return isAttribute;
-	}
-
-	public void setIsAttribute(boolean isAttribute) {
-		this.isAttribute = isAttribute;
-	}
+    private QName qName;
+    private Object value;
+    boolean isAttribute = false;
+
+    public ExtensionImpl() {
+    }
+
+    public ExtensionImpl(QName qName, Object value, boolean isAttribute) {
+        this.qName = qName;
+        this.value = value;
+        this.isAttribute = isAttribute;
+    }
+
+    public QName getQName() {
+        return qName;
+    }
+
+    public void setQName(QName qName) {
+        this.qName = qName;
+    }
+
+    public <T> T getValue() {
+        return (T) value;
+    }
+
+    public <T> void setValue(T value) {
+        this.value = value;
+    }
+
+    public boolean isAttribute() {
+        return isAttribute;
+    }
+
+    public void setIsAttribute(boolean isAttribute) {
+        this.isAttribute = isAttribute;
+    }
 }

Modified: tuscany/java/sca/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/impl/ImplementationImpl.java
URL: http://svn.apache.org/viewvc/tuscany/java/sca/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/impl/ImplementationImpl.java?rev=746356&r1=746355&r2=746356&view=diff
==============================================================================
--- tuscany/java/sca/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/impl/ImplementationImpl.java (original)
+++ tuscany/java/sca/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/impl/ImplementationImpl.java Fri Feb 20 20:10:37 2009
@@ -22,25 +22,19 @@
 import java.util.ArrayList;
 import java.util.List;
 
-import org.apache.tuscany.sca.assembly.ConfiguredOperation;
 import org.apache.tuscany.sca.assembly.Implementation;
-import org.apache.tuscany.sca.assembly.OperationsConfigurator;
+import org.apache.tuscany.sca.policy.ExtensionType;
 import org.apache.tuscany.sca.policy.Intent;
-import org.apache.tuscany.sca.policy.IntentAttachPointType;
 import org.apache.tuscany.sca.policy.PolicySet;
-import org.apache.tuscany.sca.policy.PolicySetAttachPoint;
+import org.apache.tuscany.sca.policy.PolicySubject;
 
 /**
  * Base implementation class of Implementation model interface
  *
  * @version $Rev$ $Date$
  */
-public abstract class ImplementationImpl extends ComponentTypeImpl implements Implementation, PolicySetAttachPoint,
-    OperationsConfigurator {
-
-    private List<PolicySet> applicablePolicySets = new ArrayList<PolicySet>();
-    private List<ConfiguredOperation> configuredOperations = new ArrayList<ConfiguredOperation>();
-    private IntentAttachPointType type;
+public abstract class ImplementationImpl extends ComponentTypeImpl implements Implementation, PolicySubject {
+    private ExtensionType type;
     private List<PolicySet> policySets = new ArrayList<PolicySet>();
     private List<Intent> requiredIntents = new ArrayList<Intent>();
 
@@ -48,14 +42,6 @@
         super();
     }
 
-    public List<PolicySet> getApplicablePolicySets() {
-        return applicablePolicySets;
-    }
-
-    public List<ConfiguredOperation> getConfiguredOperations() {
-        return configuredOperations;
-    }
-
     public List<PolicySet> getPolicySets() {
         return policySets;
     }
@@ -64,12 +50,11 @@
         return requiredIntents;
     }
 
-    public IntentAttachPointType getType() {
+    public ExtensionType getType() {
         return type;
     }
 
-    public void setType(IntentAttachPointType type) {
+    public void setType(ExtensionType type) {
         this.type = type;
     }
-
 }

Modified: tuscany/java/sca/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/impl/WireImpl.java
URL: http://svn.apache.org/viewvc/tuscany/java/sca/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/impl/WireImpl.java?rev=746356&r1=746355&r2=746356&view=diff
==============================================================================
--- tuscany/java/sca/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/impl/WireImpl.java (original)
+++ tuscany/java/sca/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/impl/WireImpl.java Fri Feb 20 20:10:37 2009
@@ -25,7 +25,7 @@
 import org.apache.tuscany.sca.assembly.ComponentService;
 import org.apache.tuscany.sca.assembly.Wire;
 import org.apache.tuscany.sca.policy.Intent;
-import org.apache.tuscany.sca.policy.IntentAttachPointType;
+import org.apache.tuscany.sca.policy.ExtensionType;
 import org.apache.tuscany.sca.policy.PolicySet;
 
 /**
@@ -79,11 +79,11 @@
         return policySets;
     }
 
-    public IntentAttachPointType getType() {
+    public ExtensionType getType() {
         return null;
     }
 
-    public void setType(IntentAttachPointType type) {
+    public void setType(ExtensionType type) {
     }
     
     public void setPolicySets(List<PolicySet> policySets) {

Modified: tuscany/java/sca/modules/assembly/src/test/java/org/apache/tuscany/sca/assembly/TestBinding.java
URL: http://svn.apache.org/viewvc/tuscany/java/sca/modules/assembly/src/test/java/org/apache/tuscany/sca/assembly/TestBinding.java?rev=746356&r1=746355&r2=746356&view=diff
==============================================================================
--- tuscany/java/sca/modules/assembly/src/test/java/org/apache/tuscany/sca/assembly/TestBinding.java (original)
+++ tuscany/java/sca/modules/assembly/src/test/java/org/apache/tuscany/sca/assembly/TestBinding.java Fri Feb 20 20:10:37 2009
@@ -18,13 +18,15 @@
  */
 package org.apache.tuscany.sca.assembly;
 
+import org.apache.tuscany.sca.assembly.impl.BindingImpl;
+
 
 /**
  * A test interface model.
  * 
  * @version $Rev$ $Date$
  */
-public class TestBinding implements Binding {
+public class TestBinding extends BindingImpl implements Binding {
     public TestBinding(AssemblyFactory factory) {
     }
 
@@ -35,22 +37,9 @@
     public String getURI() {
         return "http://test";
     }
-
-    public void setName(String name) {
-    }
-
-    public void setURI(String uri) {
-    }
-
-    public void setUnresolved(boolean unresolved) {
-    }
     
     public boolean isUnresolved() {
         return false;
     }
 
-    @Override
-    public Object clone() throws CloneNotSupportedException {
-        return super.clone();
-    }     
 }

Modified: tuscany/java/sca/modules/binding-sca-xml/src/main/java/org/apache/tuscany/sca/binding/sca/xml/SCABindingProcessor.java
URL: http://svn.apache.org/viewvc/tuscany/java/sca/modules/binding-sca-xml/src/main/java/org/apache/tuscany/sca/binding/sca/xml/SCABindingProcessor.java?rev=746356&r1=746355&r2=746356&view=diff
==============================================================================
--- tuscany/java/sca/modules/binding-sca-xml/src/main/java/org/apache/tuscany/sca/binding/sca/xml/SCABindingProcessor.java (original)
+++ tuscany/java/sca/modules/binding-sca-xml/src/main/java/org/apache/tuscany/sca/binding/sca/xml/SCABindingProcessor.java Fri Feb 20 20:10:37 2009
@@ -29,17 +29,16 @@
 import org.apache.tuscany.sca.assembly.SCABinding;
 import org.apache.tuscany.sca.assembly.SCABindingFactory;
 import org.apache.tuscany.sca.assembly.xml.Constants;
-import org.apache.tuscany.sca.assembly.xml.PolicyAttachPointProcessor;
+import org.apache.tuscany.sca.assembly.xml.PolicySubjectProcessor;
 import org.apache.tuscany.sca.contribution.processor.ContributionReadException;
 import org.apache.tuscany.sca.contribution.processor.ContributionResolveException;
 import org.apache.tuscany.sca.contribution.processor.ContributionWriteException;
 import org.apache.tuscany.sca.contribution.processor.StAXArtifactProcessor;
 import org.apache.tuscany.sca.contribution.resolver.ModelResolver;
 import org.apache.tuscany.sca.core.FactoryExtensionPoint;
-import org.apache.tuscany.sca.policy.IntentAttachPointType;
-import org.apache.tuscany.sca.policy.IntentAttachPointTypeFactory;
+import org.apache.tuscany.sca.policy.ExtensionType;
 import org.apache.tuscany.sca.policy.PolicyFactory;
-import org.apache.tuscany.sca.policy.PolicySetAttachPoint;
+import org.apache.tuscany.sca.policy.PolicySubject;
 
 /**
  * A processor to read the XML that describes the SCA binding.
@@ -51,8 +50,8 @@
     
     private PolicyFactory policyFactory;       
     private SCABindingFactory scaBindingFactory;
-    private PolicyAttachPointProcessor policyProcessor;
-    private IntentAttachPointTypeFactory  intentAttachPointTypeFactory;
+    private PolicySubjectProcessor policyProcessor;
+    private PolicyFactory  intentAttachPointTypeFactory;
 
     protected static final String BINDING_SCA = "binding.sca";
     protected static final QName BINDING_SCA_QNAME = new QName(Constants.SCA10_NS, BINDING_SCA);
@@ -60,8 +59,8 @@
     public SCABindingProcessor(FactoryExtensionPoint modelFactories) {
         this.policyFactory = modelFactories.getFactory(PolicyFactory.class);
         this.scaBindingFactory = modelFactories.getFactory(SCABindingFactory.class);
-        policyProcessor = new PolicyAttachPointProcessor(policyFactory);
-        this.intentAttachPointTypeFactory = modelFactories.getFactory(IntentAttachPointTypeFactory.class);
+        policyProcessor = new PolicySubjectProcessor(policyFactory);
+        this.intentAttachPointTypeFactory = modelFactories.getFactory(PolicyFactory.class);
     }
 
     public QName getArtifactType() {
@@ -74,10 +73,10 @@
 
     public SCABinding read(XMLStreamReader reader) throws ContributionReadException, XMLStreamException {
         SCABinding scaBinding = scaBindingFactory.createSCABinding();
-        IntentAttachPointType bindingType = intentAttachPointTypeFactory.createBindingType();
-        bindingType.setName(getArtifactType());
+        ExtensionType bindingType = intentAttachPointTypeFactory.createBindingType();
+        bindingType.setType(getArtifactType());
         bindingType.setUnresolved(true);
-        ((PolicySetAttachPoint)scaBinding).setType(bindingType);
+        ((PolicySubject)scaBinding).setType(bindingType);
         
         // Read policies
         policyProcessor.readPolicies(scaBinding, reader);

Modified: tuscany/java/sca/modules/binding-sca/src/main/java/org/apache/tuscany/sca/binding/sca/impl/SCABindingImpl.java
URL: http://svn.apache.org/viewvc/tuscany/java/sca/modules/binding-sca/src/main/java/org/apache/tuscany/sca/binding/sca/impl/SCABindingImpl.java?rev=746356&r1=746355&r2=746356&view=diff
==============================================================================
--- tuscany/java/sca/modules/binding-sca/src/main/java/org/apache/tuscany/sca/binding/sca/impl/SCABindingImpl.java (original)
+++ tuscany/java/sca/modules/binding-sca/src/main/java/org/apache/tuscany/sca/binding/sca/impl/SCABindingImpl.java Fri Feb 20 20:10:37 2009
@@ -30,23 +30,23 @@
 import org.apache.tuscany.sca.assembly.SCABinding;
 import org.apache.tuscany.sca.assembly.builder.AutomaticBinding;
 import org.apache.tuscany.sca.policy.Intent;
-import org.apache.tuscany.sca.policy.IntentAttachPointType;
+import org.apache.tuscany.sca.policy.ExtensionType;
 import org.apache.tuscany.sca.policy.PolicySet;
-import org.apache.tuscany.sca.policy.PolicySetAttachPoint;
+import org.apache.tuscany.sca.policy.PolicySubject;
 
 /**
  * The assembly mode object for an SCA binding.
  * 
  * @version $Rev$ $Date$
  */
-public class SCABindingImpl implements SCABinding, Extensible, PolicySetAttachPoint, OptimizableBinding, AutomaticBinding {
+public class SCABindingImpl implements SCABinding, Extensible, PolicySubject, OptimizableBinding, AutomaticBinding {
     private String name;
     private String uri;
     private List<Object> extensions = new ArrayList<Object>();
     private List<Extension> attributeExtensions = new ArrayList<Extension>();
     private List<Intent> requiredIntents = new ArrayList<Intent>();
     private List<PolicySet> policySets = new ArrayList<PolicySet>();
-    private IntentAttachPointType intentAttachPointType;
+    private ExtensionType intentAttachPointType;
     
     private Component targetComponent;
     private ComponentService targetComponentService;
@@ -154,11 +154,11 @@
         return requiredIntents;
     }
 
-    public IntentAttachPointType getType() {
+    public ExtensionType getType() {
         return intentAttachPointType;
     }
     
-    public void setType(IntentAttachPointType intentAttachPointType) {
+    public void setType(ExtensionType intentAttachPointType) {
         this.intentAttachPointType = intentAttachPointType;
     }
     

Modified: tuscany/java/sca/modules/binding-sca/src/main/resources/org/apache/tuscany/sca/binding/sca/definitions.xml
URL: http://svn.apache.org/viewvc/tuscany/java/sca/modules/binding-sca/src/main/resources/org/apache/tuscany/sca/binding/sca/definitions.xml?rev=746356&r1=746355&r2=746356&view=diff
==============================================================================
--- tuscany/java/sca/modules/binding-sca/src/main/resources/org/apache/tuscany/sca/binding/sca/definitions.xml (original)
+++ tuscany/java/sca/modules/binding-sca/src/main/resources/org/apache/tuscany/sca/binding/sca/definitions.xml Fri Feb 20 20:10:37 2009
@@ -17,9 +17,9 @@
  * specific language governing permissions and limitations
  * under the License.    
 -->
-<sca:definitions xmlns="http://www.osoa.org/xmlns/sca/1.0"
- 			targetNamespace="http://www.osoa.org/xmlns/sca/1.0"
- 			xmlns:sca="http://www.osoa.org/xmlns/sca/1.0"
+<sca:definitions xmlns="http://docs.oasis-open.org/ns/opencsa/sca/200712"
+ 			targetNamespace="http://docs.oasis-open.org/ns/opencsa/sca/200712"
+ 			xmlns:sca="http://docs.oasis-open.org/ns/opencsa/sca/200712"
  			xmlns:tuscany="http://tuscany.apache.org/xmlns/sca/1.0">
  			
 	<sca:bindingType type="sca:binding.sca"  mayProvide="" alwaysProvides=""/>	 		

Modified: tuscany/java/sca/modules/binding-sca/src/test/java/org/apace/tuscany/sca/binding/sca/SCABindingTestCase.java
URL: http://svn.apache.org/viewvc/tuscany/java/sca/modules/binding-sca/src/test/java/org/apace/tuscany/sca/binding/sca/SCABindingTestCase.java?rev=746356&r1=746355&r2=746356&view=diff
==============================================================================
--- tuscany/java/sca/modules/binding-sca/src/test/java/org/apace/tuscany/sca/binding/sca/SCABindingTestCase.java (original)
+++ tuscany/java/sca/modules/binding-sca/src/test/java/org/apace/tuscany/sca/binding/sca/SCABindingTestCase.java Fri Feb 20 20:10:37 2009
@@ -36,7 +36,7 @@
 import org.apache.tuscany.sca.contribution.processor.StAXArtifactProcessorExtensionPoint;
 import org.apache.tuscany.sca.core.DefaultExtensionPointRegistry;
 import org.apache.tuscany.sca.core.FactoryExtensionPoint;
-import org.apache.tuscany.sca.policy.IntentAttachPointTypeFactory;
+import org.apache.tuscany.sca.policy.PolicyFactory;
 import org.junit.Assert;
 import org.junit.Before;
 import org.junit.Test;
@@ -66,7 +66,7 @@
         FactoryExtensionPoint modelFactories = extensionPoints.getExtensionPoint(FactoryExtensionPoint.class);
         AssemblyFactory assemblyFactory = modelFactories.getFactory(AssemblyFactory.class);
         SCABindingFactory scaBindingFactory = modelFactories.getFactory(SCABindingFactory.class);
-        IntentAttachPointTypeFactory attachPointTypeFactory = modelFactories.getFactory(IntentAttachPointTypeFactory.class);
+        PolicyFactory attachPointTypeFactory = modelFactories.getFactory(PolicyFactory.class);
 
         compositeBuilder = extensionPoints.getExtensionPoint(CompositeBuilderExtensionPoint.class).getCompositeBuilder("org.apache.tuscany.sca.assembly.builder.CompositeBuilder");
         

Modified: tuscany/java/sca/modules/binding-ws-axis2-policy/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/policy/authentication/token/Axis2TokenAuthenticationPolicy.java
URL: http://svn.apache.org/viewvc/tuscany/java/sca/modules/binding-ws-axis2-policy/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/policy/authentication/token/Axis2TokenAuthenticationPolicy.java?rev=746356&r1=746355&r2=746356&view=diff
==============================================================================
--- tuscany/java/sca/modules/binding-ws-axis2-policy/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/policy/authentication/token/Axis2TokenAuthenticationPolicy.java (original)
+++ tuscany/java/sca/modules/binding-ws-axis2-policy/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/policy/authentication/token/Axis2TokenAuthenticationPolicy.java Fri Feb 20 20:10:37 2009
@@ -20,15 +20,13 @@
 
 import javax.xml.namespace.QName;
 
-import org.apache.tuscany.sca.policy.Policy;
-
 /**
  * Implementation for policies that could be injected as parameter
  * into the axis2config.
  *
  * @version $Rev: 695374 $ $Date: 2008-09-15 09:07:58 +0100 (Mon, 15 Sep 2008) $
  */
-public class Axis2TokenAuthenticationPolicy implements Policy {
+public class Axis2TokenAuthenticationPolicy {
     private static final String SCA10_TUSCANY_NS = "http://tuscany.apache.org/xmlns/sca/1.0";
     public static final QName AXIS2_TOKEN_AUTHENTICATION_POLICY_QNAME = new QName(SCA10_TUSCANY_NS, "axis2TokenAuthentication");
     public static final String AXIS2_TOKEN_AUTHENTICATION_TOKEN_NAME = "tokenName";

Modified: tuscany/java/sca/modules/binding-ws-axis2-policy/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/policy/authentication/token/Axis2TokenAuthenticationReferencePolicyProvider.java
URL: http://svn.apache.org/viewvc/tuscany/java/sca/modules/binding-ws-axis2-policy/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/policy/authentication/token/Axis2TokenAuthenticationReferencePolicyProvider.java?rev=746356&r1=746355&r2=746356&view=diff
==============================================================================
--- tuscany/java/sca/modules/binding-ws-axis2-policy/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/policy/authentication/token/Axis2TokenAuthenticationReferencePolicyProvider.java (original)
+++ tuscany/java/sca/modules/binding-ws-axis2-policy/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/policy/authentication/token/Axis2TokenAuthenticationReferencePolicyProvider.java Fri Feb 20 20:10:37 2009
@@ -26,7 +26,7 @@
 import org.apache.tuscany.sca.invocation.Interceptor;
 import org.apache.tuscany.sca.invocation.Phase;
 import org.apache.tuscany.sca.policy.PolicySet;
-import org.apache.tuscany.sca.policy.PolicySetAttachPoint;
+import org.apache.tuscany.sca.policy.PolicySubject;
 import org.apache.tuscany.sca.provider.PolicyProvider;
 import org.apache.tuscany.sca.runtime.RuntimeComponent;
 import org.apache.tuscany.sca.runtime.RuntimeComponentReference;
@@ -49,8 +49,8 @@
     }
 
     private PolicySet findPolicySet() {
-        if (binding instanceof PolicySetAttachPoint) {
-            List<PolicySet> policySets = ((PolicySetAttachPoint)binding).getApplicablePolicySets();
+        if (binding instanceof PolicySubject) {
+            List<PolicySet> policySets = ((PolicySubject)binding).getPolicySets();
             for (PolicySet ps : policySets) {
                 for (Object p : ps.getPolicies()) {
                     if (Axis2TokenAuthenticationPolicy.class.isInstance(p)) {

Modified: tuscany/java/sca/modules/binding-ws-axis2-policy/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/policy/authentication/token/Axis2TokenAuthenticationServicePolicyProvider.java
URL: http://svn.apache.org/viewvc/tuscany/java/sca/modules/binding-ws-axis2-policy/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/policy/authentication/token/Axis2TokenAuthenticationServicePolicyProvider.java?rev=746356&r1=746355&r2=746356&view=diff
==============================================================================
--- tuscany/java/sca/modules/binding-ws-axis2-policy/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/policy/authentication/token/Axis2TokenAuthenticationServicePolicyProvider.java (original)
+++ tuscany/java/sca/modules/binding-ws-axis2-policy/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/policy/authentication/token/Axis2TokenAuthenticationServicePolicyProvider.java Fri Feb 20 20:10:37 2009
@@ -26,7 +26,7 @@
 import org.apache.tuscany.sca.invocation.Interceptor;
 import org.apache.tuscany.sca.invocation.Phase;
 import org.apache.tuscany.sca.policy.PolicySet;
-import org.apache.tuscany.sca.policy.PolicySetAttachPoint;
+import org.apache.tuscany.sca.policy.PolicySubject;
 import org.apache.tuscany.sca.provider.PolicyProvider;
 import org.apache.tuscany.sca.runtime.RuntimeComponent;
 import org.apache.tuscany.sca.runtime.RuntimeComponentService;
@@ -47,8 +47,8 @@
     }
 
     private PolicySet findPolicySet() {
-        if (binding instanceof PolicySetAttachPoint) {
-            List<PolicySet> policySets = ((PolicySetAttachPoint)binding).getApplicablePolicySets();
+        if (binding instanceof PolicySubject) {
+            List<PolicySet> policySets = ((PolicySubject)binding).getPolicySets();
             for (PolicySet ps : policySets) {
                 for (Object p : ps.getPolicies()) {
                     if (Axis2TokenAuthenticationPolicy.class.isInstance(p)) {

Modified: tuscany/java/sca/modules/binding-ws-axis2-policy/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/policy/configuration/Axis2ConfigParamPolicy.java
URL: http://svn.apache.org/viewvc/tuscany/java/sca/modules/binding-ws-axis2-policy/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/policy/configuration/Axis2ConfigParamPolicy.java?rev=746356&r1=746355&r2=746356&view=diff
==============================================================================
--- tuscany/java/sca/modules/binding-ws-axis2-policy/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/policy/configuration/Axis2ConfigParamPolicy.java (original)
+++ tuscany/java/sca/modules/binding-ws-axis2-policy/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/policy/configuration/Axis2ConfigParamPolicy.java Fri Feb 20 20:10:37 2009
@@ -24,7 +24,6 @@
 import javax.xml.namespace.QName;
 
 import org.apache.axiom.om.OMElement;
-import org.apache.tuscany.sca.policy.Policy;
 
 /**
  * Implementation for policies that could be injected as parameter
@@ -32,7 +31,7 @@
  *
  * @version $Rev$ $Date$
  */
-public class Axis2ConfigParamPolicy implements Policy {
+public class Axis2ConfigParamPolicy {
     private static final String SCA10_TUSCANY_NS = "http://tuscany.apache.org/xmlns/sca/1.0";
     public static final QName NAME = new QName(SCA10_TUSCANY_NS, "wsConfigParam");
     private Map<String, OMElement> paramElements = new Hashtable<String, OMElement>();

Modified: tuscany/java/sca/modules/binding-ws-axis2-policy/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/policy/configuration/Axis2ConfigParamPolicyHandler.java
URL: http://svn.apache.org/viewvc/tuscany/java/sca/modules/binding-ws-axis2-policy/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/policy/configuration/Axis2ConfigParamPolicyHandler.java?rev=746356&r1=746355&r2=746356&view=diff
==============================================================================
--- tuscany/java/sca/modules/binding-ws-axis2-policy/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/policy/configuration/Axis2ConfigParamPolicyHandler.java (original)
+++ tuscany/java/sca/modules/binding-ws-axis2-policy/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/policy/configuration/Axis2ConfigParamPolicyHandler.java Fri Feb 20 20:10:37 2009
@@ -23,7 +23,6 @@
 import org.apache.axis2.context.ConfigurationContext;
 import org.apache.axis2.description.Parameter;
 import org.apache.tuscany.sca.policy.PolicySet;
-import org.apache.tuscany.sca.policy.util.PolicyHandler;
 
 
 /**
@@ -31,7 +30,7 @@
  *
  * @version $Rev$ $Date$
  */
-public class Axis2ConfigParamPolicyHandler implements PolicyHandler {
+public class Axis2ConfigParamPolicyHandler {
     private PolicySet applicablePolicySet = null;
     
     public void setUp(Object... context) {

Modified: tuscany/java/sca/modules/binding-ws-axis2-policy/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/policy/header/Axis2HeaderPolicy.java
URL: http://svn.apache.org/viewvc/tuscany/java/sca/modules/binding-ws-axis2-policy/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/policy/header/Axis2HeaderPolicy.java?rev=746356&r1=746355&r2=746356&view=diff
==============================================================================
--- tuscany/java/sca/modules/binding-ws-axis2-policy/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/policy/header/Axis2HeaderPolicy.java (original)
+++ tuscany/java/sca/modules/binding-ws-axis2-policy/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/policy/header/Axis2HeaderPolicy.java Fri Feb 20 20:10:37 2009
@@ -20,15 +20,13 @@
 
 import javax.xml.namespace.QName;
 
-import org.apache.tuscany.sca.policy.Policy;
-
 /**
  * Implementation for policies that could be injected as parameter
  * into the axis2config.
  *
  * @version $Rev$ $Date$
  */
-public class Axis2HeaderPolicy implements Policy {
+public class Axis2HeaderPolicy {
     private static final String SCA10_TUSCANY_NS = "http://tuscany.apache.org/xmlns/sca/1.0";
     public static final QName AXIS2_HEADER_POLICY_QNAME = new QName(SCA10_TUSCANY_NS, "axis2Header");
     public static final String AXIS2_HEADER_NAME = "headerName";

Modified: tuscany/java/sca/modules/binding-ws-axis2-policy/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/policy/header/Axis2HeaderReferencePolicyProvider.java
URL: http://svn.apache.org/viewvc/tuscany/java/sca/modules/binding-ws-axis2-policy/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/policy/header/Axis2HeaderReferencePolicyProvider.java?rev=746356&r1=746355&r2=746356&view=diff
==============================================================================
--- tuscany/java/sca/modules/binding-ws-axis2-policy/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/policy/header/Axis2HeaderReferencePolicyProvider.java (original)
+++ tuscany/java/sca/modules/binding-ws-axis2-policy/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/policy/header/Axis2HeaderReferencePolicyProvider.java Fri Feb 20 20:10:37 2009
@@ -26,7 +26,7 @@
 import org.apache.tuscany.sca.invocation.Interceptor;
 import org.apache.tuscany.sca.invocation.Phase;
 import org.apache.tuscany.sca.policy.PolicySet;
-import org.apache.tuscany.sca.policy.PolicySetAttachPoint;
+import org.apache.tuscany.sca.policy.PolicySubject;
 import org.apache.tuscany.sca.provider.PolicyProvider;
 import org.apache.tuscany.sca.runtime.RuntimeComponent;
 import org.apache.tuscany.sca.runtime.RuntimeComponentReference;
@@ -48,9 +48,10 @@
         this.binding = binding;
     }
 
+    // FIXME: Need to use the endpoint with effective policies
     private PolicySet findPolicySet() {
-        if (binding instanceof PolicySetAttachPoint) {
-            List<PolicySet> policySets = ((PolicySetAttachPoint)binding).getApplicablePolicySets();
+        if (binding instanceof PolicySubject) {
+            List<PolicySet> policySets = ((PolicySubject)binding).getPolicySets();
             for (PolicySet ps : policySets) {
                 for (Object p : ps.getPolicies()) {
                     if (Axis2HeaderPolicy.class.isInstance(p)) {

Modified: tuscany/java/sca/modules/binding-ws-axis2-policy/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/policy/header/Axis2HeaderServicePolicyProvider.java
URL: http://svn.apache.org/viewvc/tuscany/java/sca/modules/binding-ws-axis2-policy/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/policy/header/Axis2HeaderServicePolicyProvider.java?rev=746356&r1=746355&r2=746356&view=diff
==============================================================================
--- tuscany/java/sca/modules/binding-ws-axis2-policy/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/policy/header/Axis2HeaderServicePolicyProvider.java (original)
+++ tuscany/java/sca/modules/binding-ws-axis2-policy/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/policy/header/Axis2HeaderServicePolicyProvider.java Fri Feb 20 20:10:37 2009
@@ -26,7 +26,7 @@
 import org.apache.tuscany.sca.invocation.Interceptor;
 import org.apache.tuscany.sca.invocation.Phase;
 import org.apache.tuscany.sca.policy.PolicySet;
-import org.apache.tuscany.sca.policy.PolicySetAttachPoint;
+import org.apache.tuscany.sca.policy.PolicySubject;
 import org.apache.tuscany.sca.provider.PolicyProvider;
 import org.apache.tuscany.sca.runtime.RuntimeComponent;
 import org.apache.tuscany.sca.runtime.RuntimeComponentService;
@@ -47,8 +47,8 @@
     }
 
     private PolicySet findPolicySet() {
-        if (binding instanceof PolicySetAttachPoint) {
-            List<PolicySet> policySets = ((PolicySetAttachPoint)binding).getApplicablePolicySets();
+        if (binding instanceof PolicySubject) {
+            List<PolicySet> policySets = ((PolicySubject)binding).getPolicySets();
             for (PolicySet ps : policySets) {
                 for (Object p : ps.getPolicies()) {
                     if (Axis2HeaderPolicy.class.isInstance(p)) {

Modified: tuscany/java/sca/modules/binding-ws-axis2/pom.xml
URL: http://svn.apache.org/viewvc/tuscany/java/sca/modules/binding-ws-axis2/pom.xml?rev=746356&r1=746355&r2=746356&view=diff
==============================================================================
--- tuscany/java/sca/modules/binding-ws-axis2/pom.xml (original)
+++ tuscany/java/sca/modules/binding-ws-axis2/pom.xml Fri Feb 20 20:10:37 2009
@@ -66,6 +66,13 @@
 
         <dependency>
             <groupId>org.apache.tuscany.sca</groupId>
+            <artifactId>tuscany-policy-xml</artifactId>
+            <version>2.0-SNAPSHOT</version>
+            <scope>runtime</scope>
+        </dependency>
+        
+        <dependency>
+            <groupId>org.apache.tuscany.sca</groupId>
             <artifactId>tuscany-binding-ws</artifactId>
             <version>2.0-SNAPSHOT</version>
         </dependency>

Modified: tuscany/java/sca/modules/binding-ws-axis2/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/Axis2BindingInvoker.java
URL: http://svn.apache.org/viewvc/tuscany/java/sca/modules/binding-ws-axis2/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/Axis2BindingInvoker.java?rev=746356&r1=746355&r2=746356&view=diff
==============================================================================
--- tuscany/java/sca/modules/binding-ws-axis2/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/Axis2BindingInvoker.java (original)
+++ tuscany/java/sca/modules/binding-ws-axis2/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/Axis2BindingInvoker.java Fri Feb 20 20:10:37 2009
@@ -48,12 +48,10 @@
 import org.apache.tuscany.sca.invocation.DataExchangeSemantics;
 import org.apache.tuscany.sca.invocation.Invoker;
 import org.apache.tuscany.sca.invocation.Message;
-import org.apache.tuscany.sca.policy.PolicySet;
-import org.apache.tuscany.sca.policy.PolicySetAttachPoint;
 import org.apache.tuscany.sca.policy.authentication.basic.BasicAuthenticationPolicy;
-import org.apache.tuscany.sca.policy.util.PolicyHandler;
 import org.apache.tuscany.sca.runtime.ReferenceParameters;
 
+
 /**
  * Axis2BindingInvoker uses an Axis2 OperationClient to invoke a remote web service
  *
@@ -75,7 +73,6 @@
     private QName wsdlOperationName;
     private Options options;
     private SOAPFactory soapFactory;    
-    private List<PolicyHandler> policyHandlerList = null;
     private WebServiceBinding wsBinding;
     
     private BasicAuthenticationPolicy basicAuthenticationPolicy = null;
@@ -86,18 +83,17 @@
                                QName wsdlOperationName,
                                Options options,
                                SOAPFactory soapFactory,
-                               List<PolicyHandler> policyHandlerList,
                                WebServiceBinding wsBinding) {
         this.serviceClient = serviceClient;
         this.wsdlOperationName = wsdlOperationName;
         this.options = options;
         this.soapFactory = soapFactory;
-        this.policyHandlerList = policyHandlerList;
         this.wsBinding = wsBinding;
         
         // find out which policies are active
-        if (wsBinding instanceof PolicySetAttachPoint) {
-            List<PolicySet> policySets = ((PolicySetAttachPoint)wsBinding).getApplicablePolicySets();
+        /*
+        if (wsBinding instanceof PolicySubject) {
+            List<PolicySet> policySets = ((PolicySubject)wsBinding).getPolicySets();
             for (PolicySet ps : policySets) {
                 for (Object p : ps.getPolicies()) {
                     if (BasicAuthenticationPolicy.class.isInstance(p)) {
@@ -112,6 +108,7 @@
                 }
             }
         }
+        */
     }
 
     private static final QName EXCEPTION = new QName("", "Exception");
@@ -144,9 +141,11 @@
         requestMC.getOptions().setProperty(HTTPConstants.REUSE_HTTP_CLIENT, Boolean.TRUE);
         requestMC.getOptions().setTimeOutInMilliSeconds(240000L);
 
+        /*
         for ( PolicyHandler policyHandler : policyHandlerList ) {
             policyHandler.beforeInvoke(msg, requestMC, operationClient);
         }
+        */
         
         // set policy specified headers
         for (Axis2HeaderPolicy policy : axis2HeaderPolicies){
@@ -177,9 +176,11 @@
 
         MessageContext responseMC = operationClient.getMessageContext("In");
         
+        /*
         for ( PolicyHandler policyHandler : policyHandlerList ) {
             policyHandler.afterInvoke(msg, responseMC, operationClient);
         }
+        */
         
         OMElement response = responseMC.getEnvelope().getBody().getFirstElement();
 



Mime
View raw message