summaryrefslogtreecommitdiffstats
path: root/sca-java-2.x/trunk/modules/assembly/src/main/java/org/apache/tuscany/sca/interfacedef/impl/InterfaceContractMapperImpl.java
diff options
context:
space:
mode:
authorrfeng <rfeng@13f79535-47bb-0310-9956-ffa450edef68>2010-02-25 23:00:57 +0000
committerrfeng <rfeng@13f79535-47bb-0310-9956-ffa450edef68>2010-02-25 23:00:57 +0000
commitd7c15da034109074d717d3f9f0c3325a54b597dd (patch)
tree553365305a3bad892346fb83cf92187b24ca0288 /sca-java-2.x/trunk/modules/assembly/src/main/java/org/apache/tuscany/sca/interfacedef/impl/InterfaceContractMapperImpl.java
parentf026711cd4af3326d8e40a428954f822f65e4c80 (diff)
Add the check for local-by-reference, local-by-value and remote invocations for binding.sca
git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@916483 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to '')
-rw-r--r--sca-java-2.x/trunk/modules/assembly/src/main/java/org/apache/tuscany/sca/interfacedef/impl/InterfaceContractMapperImpl.java19
1 files changed, 15 insertions, 4 deletions
diff --git a/sca-java-2.x/trunk/modules/assembly/src/main/java/org/apache/tuscany/sca/interfacedef/impl/InterfaceContractMapperImpl.java b/sca-java-2.x/trunk/modules/assembly/src/main/java/org/apache/tuscany/sca/interfacedef/impl/InterfaceContractMapperImpl.java
index dc1c0c0a4e..5c561b2ddf 100644
--- a/sca-java-2.x/trunk/modules/assembly/src/main/java/org/apache/tuscany/sca/interfacedef/impl/InterfaceContractMapperImpl.java
+++ b/sca-java-2.x/trunk/modules/assembly/src/main/java/org/apache/tuscany/sca/interfacedef/impl/InterfaceContractMapperImpl.java
@@ -116,6 +116,10 @@ public class InterfaceContractMapperImpl implements InterfaceContractMapper {
} // end method isEqual
public boolean isCompatible(Operation source, Operation target, Compatibility compatibilityType) {
+ return isCompatible(source, target, compatibilityType, true);
+ }
+
+ public boolean isCompatible(Operation source, Operation target, Compatibility compatibilityType, boolean byValue) {
if (source == target) {
return true;
}
@@ -133,7 +137,7 @@ public class InterfaceContractMapperImpl implements InterfaceContractMapper {
return false;
}
- boolean remotable = source.getInterface().isRemotable();
+ boolean passByValue = (source.getInterface().isRemotable()) && byValue;
// if (source.getInterface().isRemotable()) {
// return true;
@@ -164,7 +168,7 @@ public class InterfaceContractMapperImpl implements InterfaceContractMapper {
return true;
}
- if (!isCompatible(targetOutputType, sourceOutputType, remotable)) {
+ if (!isCompatible(targetOutputType, sourceOutputType, passByValue)) {
return false;
}
@@ -174,7 +178,7 @@ public class InterfaceContractMapperImpl implements InterfaceContractMapper {
int size = sourceInputType.size();
for (int i = 0; i < size; i++) {
- if (!isCompatible(sourceInputType.get(i), targetInputType.get(i), remotable)) {
+ if (!isCompatible(sourceInputType.get(i), targetInputType.get(i), passByValue)) {
return false;
}
}
@@ -186,7 +190,7 @@ public class InterfaceContractMapperImpl implements InterfaceContractMapper {
boolean found = true;
for (DataType sourceFaultType : source.getFaultTypes()) {
found = false;
- if (isCompatible(targetFaultType, sourceFaultType, remotable)) {
+ if (isCompatible(targetFaultType, sourceFaultType, passByValue)) {
// Target fault type can be covered by the source fault type
found = true;
break;
@@ -198,6 +202,13 @@ public class InterfaceContractMapperImpl implements InterfaceContractMapper {
}
return true;
+ }
+ public boolean isCompatibleByReference(Operation source, Operation target, Compatibility compatibilityType) {
+ return isCompatible(source, target, compatibilityType, false);
+ }
+
+ public boolean isCompatibleByValue(Operation source, Operation target, Compatibility compatibilityType) {
+ return isCompatible(source, target, compatibilityType, true);
}
// FIXME: How to improve the performance for the lookup