summaryrefslogtreecommitdiffstats
path: root/sca-java-2.x/trunk/modules/core-databinding
diff options
context:
space:
mode:
authorantelder <antelder@13f79535-47bb-0310-9956-ffa450edef68>2010-02-11 04:21:00 +0000
committerantelder <antelder@13f79535-47bb-0310-9956-ffa450edef68>2010-02-11 04:21:00 +0000
commit45f532168598a09d523eb051fa78c6416f913b2a (patch)
tree5f2b518acfca5ae0a285f1ace69b5af7ebcd8dd7 /sca-java-2.x/trunk/modules/core-databinding
parentfd16cfb3af0bb7063dcc59210b475dbc98bc3424 (diff)
TUSCANY-2586: Fix pass-by-value copies as described in the JIRA with the SCA binding doing the necessary copies. Also update the copy code so that the new copy is in the correct class loader so that invocations across Nodes in the same JVM work
git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@908835 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'sca-java-2.x/trunk/modules/core-databinding')
-rw-r--r--sca-java-2.x/trunk/modules/core-databinding/src/main/java/org/apache/tuscany/sca/core/databinding/wire/DataBindingRuntimeWireProcessor.java43
1 files changed, 2 insertions, 41 deletions
diff --git a/sca-java-2.x/trunk/modules/core-databinding/src/main/java/org/apache/tuscany/sca/core/databinding/wire/DataBindingRuntimeWireProcessor.java b/sca-java-2.x/trunk/modules/core-databinding/src/main/java/org/apache/tuscany/sca/core/databinding/wire/DataBindingRuntimeWireProcessor.java
index 27c25e7f71..0e615519f1 100644
--- a/sca-java-2.x/trunk/modules/core-databinding/src/main/java/org/apache/tuscany/sca/core/databinding/wire/DataBindingRuntimeWireProcessor.java
+++ b/sca-java-2.x/trunk/modules/core-databinding/src/main/java/org/apache/tuscany/sca/core/databinding/wire/DataBindingRuntimeWireProcessor.java
@@ -123,29 +123,6 @@ public class DataBindingRuntimeWireProcessor implements RuntimeWireProcessor {
return isTransformationRequired(sourceOperation, targetOperation);
}
- /**
- * FIXME: TUSCANY-2586, temporary work around till the JIRA is fixed to prevent
- * the PassByValueInterceptor being used for services when the binding protocol
- * doesn't need the copies done.
- */
- protected boolean isOnMessage(Operation op) {
- return "onMessage".equals(op.getName());
- }
-
- /**
- * Pass-by-value copies are required if the interfaces are remotable unless the
- * implementation uses the @AllowsPassByReference annotation.
- */
- protected boolean isRemotable(InvocationChain chain, Operation sourceOperation, Operation targetOperation) {
- if (!sourceOperation.getInterface().isRemotable()) {
- return false;
- }
- if (!targetOperation.getInterface().isRemotable()) {
- return false;
- }
- return true;
- }
-
public void process(RuntimeEndpoint endpoint) {
InterfaceContract sourceContract = endpoint.getBindingInterfaceContract();
InterfaceContract targetContract = endpoint.getComponentTypeServiceInterfaceContract();
@@ -165,15 +142,7 @@ public class DataBindingRuntimeWireProcessor implements RuntimeWireProcessor {
if (isTransformationRequired(sourceContract, sourceOperation, targetContract, targetOperation)) {
// Add the interceptor to the source side because multiple
// references can be wired to the same service
- interceptor =
- new DataTransformationInterceptor(endpoint, sourceOperation, targetOperation, mediator);
- } else {
- // assume pass-by-values copies are required if interfaces are remotable and there is no data binding
- // transformation, i.e. a transformation will result in a copy so another pass-by-value copy is unnecessary
- if (!isOnMessage(targetOperation) && isRemotable(chain, sourceOperation, targetOperation)) {
- interceptor =
- new PassByValueInterceptor(mediator, chain, targetOperation);
- }
+ interceptor = new DataTransformationInterceptor(endpoint, sourceOperation, targetOperation, mediator);
}
if (interceptor != null) {
String phase = Phase.SERVICE_INTERFACE;
@@ -202,15 +171,7 @@ public class DataBindingRuntimeWireProcessor implements RuntimeWireProcessor {
if (isTransformationRequired(sourceContract, sourceOperation, targetContract, targetOperation)) {
// Add the interceptor to the source side because multiple
// references can be wired to the same service
- interceptor =
- new DataTransformationInterceptor(endpointReference, sourceOperation, targetOperation, mediator);
- } else {
- // assume pass-by-values copies are required if interfaces are remotable and there is no data binding
- // transformation, i.e. a transformation will result in a copy so another pass-by-value copy is unnecessary
- if (!isOnMessage(targetOperation) && isRemotable(chain, sourceOperation, targetOperation)) {
- interceptor =
- new PassByValueInterceptor(mediator, chain, targetOperation);
- }
+ interceptor = new DataTransformationInterceptor(endpointReference, sourceOperation, targetOperation, mediator);
}
if (interceptor != null) {
String phase = Phase.REFERENCE_INTERFACE;