You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tuscany.apache.org by sl...@apache.org on 2010/03/04 12:02:44 UTC
svn commit: r918932 -
/tuscany/sca-java-2.x/trunk/modules/core/src/main/java/org/apache/tuscany/sca/core/runtime/impl/EndpointReferenceBinderImpl.java
Author: slaws
Date: Thu Mar 4 11:02:43 2010
New Revision: 918932
URL: http://svn.apache.org/viewvc?rev=918932&view=rev
Log:
Add matching algorithm narative
Modified:
tuscany/sca-java-2.x/trunk/modules/core/src/main/java/org/apache/tuscany/sca/core/runtime/impl/EndpointReferenceBinderImpl.java
Modified: tuscany/sca-java-2.x/trunk/modules/core/src/main/java/org/apache/tuscany/sca/core/runtime/impl/EndpointReferenceBinderImpl.java
URL: http://svn.apache.org/viewvc/tuscany/sca-java-2.x/trunk/modules/core/src/main/java/org/apache/tuscany/sca/core/runtime/impl/EndpointReferenceBinderImpl.java?rev=918932&r1=918931&r2=918932&view=diff
==============================================================================
--- tuscany/sca-java-2.x/trunk/modules/core/src/main/java/org/apache/tuscany/sca/core/runtime/impl/EndpointReferenceBinderImpl.java (original)
+++ tuscany/sca-java-2.x/trunk/modules/core/src/main/java/org/apache/tuscany/sca/core/runtime/impl/EndpointReferenceBinderImpl.java Thu Mar 4 11:02:43 2010
@@ -378,7 +378,16 @@
* - a given endpoint or endpoint reference's policy sets will only contain
* expressions from a single language
*
- * TODO - narative of matching algorithm
+ * Matching algorithm (read from the top down):
+ * - FAIL if there are intents that are mutually exclusive between reference and service
+ * - PASS if there are no intents or policies present at reference and service
+ * - FAIL if there are unresolved intents (intents with no policy set) at the reference (service should have been checked previously)
+ * - PASS if there are no policies at reference and service (now we know all intents are resolved)
+ * - FAIL if there are some policies on one side but not on the other
+ * - PASS if the QName of the policy sets on each side match
+ * - FAIL if the policy languages on both sides are different
+ * - Perform policy specific match
+ *
*/
private boolean haveMatchingPolicy(EndpointReference endpointReference, Endpoint endpoint, StringBuffer matchAudit){
matchAudit.append("Match policy of " + endpointReference.toString() + " to " + endpoint.toString() + " ");
@@ -455,7 +464,7 @@
(endpoint.getRequiredIntents().size() == 0) &&
(noEndpointReferencePolicies) &&
(noEndpointPolicies)) {
- matchAudit.append("Match because there are no intents or policy sets ");
+ matchAudit.append("Match because there are no intents or policies ");
return true;
}
@@ -517,7 +526,7 @@
return false;
}
- // if there are no policy sets on epr or ep side then
+ // if there are no policies on epr or ep side then
// they match
if (noEndpointPolicies && noEndpointReferencePolicies){
matchAudit.append("Match because the intents are resolved and there are no policy sets ");