You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tuscany.apache.org by an...@apache.org on 2007/02/23 14:14:17 UTC
svn commit: r510935 - in
/incubator/tuscany/branches/sca-java-integration/sca/kernel/core/src:
main/java/org/apache/tuscany/core/databinding/impl/
test/java/org/apache/tuscany/core/databinding/impl/
Author: antelder
Date: Fri Feb 23 05:14:17 2007
New Revision: 510935
URL: http://svn.apache.org/viewvc?view=rev&rev=510935
Log:
Have PassByValue interceptor take account of the allowsPassByReference annotation
Modified:
incubator/tuscany/branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/databinding/impl/PassByValueWirePostProcessor.java
incubator/tuscany/branches/sca-java-integration/sca/kernel/core/src/test/java/org/apache/tuscany/core/databinding/impl/PassByValueWirePostProcessorTestCase.java
Modified: incubator/tuscany/branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/databinding/impl/PassByValueWirePostProcessor.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/databinding/impl/PassByValueWirePostProcessor.java?view=diff&rev=510935&r1=510934&r2=510935
==============================================================================
--- incubator/tuscany/branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/databinding/impl/PassByValueWirePostProcessor.java (original)
+++ incubator/tuscany/branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/databinding/impl/PassByValueWirePostProcessor.java Fri Feb 23 05:14:17 2007
@@ -36,6 +36,7 @@
import org.apache.tuscany.spi.wire.Interceptor;
import org.apache.tuscany.spi.wire.OutboundWire;
import org.apache.tuscany.spi.wire.WirePostProcessorExtension;
+import org.osoa.sca.annotations.Remotable;
/**
* This processor is responsible for enforcing the pass-by-value semantics required of Remotable interfaces. This is
@@ -71,7 +72,11 @@
boolean implAllowsPassByReference = false;
boolean methodAllowsPassByReference = false;
- if (target.getContainer() instanceof AtomicComponentExtension) {
+ if (target.getServiceContract().getInterfaceClass() != null) {
+ Class ic = target.getServiceContract().getInterfaceClass();
+ implAllowsPassByReference = ic.getAnnotation(Remotable.class) != null;
+ }
+ if (!implAllowsPassByReference && target.getContainer() instanceof AtomicComponentExtension) {
implAllowsPassByReference =
((AtomicComponentExtension) target.getContainer()).isAllowsPassByReference();
}
Modified: incubator/tuscany/branches/sca-java-integration/sca/kernel/core/src/test/java/org/apache/tuscany/core/databinding/impl/PassByValueWirePostProcessorTestCase.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/branches/sca-java-integration/sca/kernel/core/src/test/java/org/apache/tuscany/core/databinding/impl/PassByValueWirePostProcessorTestCase.java?view=diff&rev=510935&r1=510934&r2=510935
==============================================================================
--- incubator/tuscany/branches/sca-java-integration/sca/kernel/core/src/test/java/org/apache/tuscany/core/databinding/impl/PassByValueWirePostProcessorTestCase.java (original)
+++ incubator/tuscany/branches/sca-java-integration/sca/kernel/core/src/test/java/org/apache/tuscany/core/databinding/impl/PassByValueWirePostProcessorTestCase.java Fri Feb 23 05:14:17 2007
@@ -88,6 +88,7 @@
OutboundInvocationChainImpl outChain = new OutboundInvocationChainImpl(operation1);
outChainsMap.put(operation1, outChain);
+ expect(inboundWire.getServiceContract()).andReturn(serviceContract);
expect(inboundWire.getContainer()).andReturn(componentExtn).anyTimes();
expect(outboundWire.getContainer()).andReturn(componentExtn).anyTimes();
expect(inboundWire.getServiceContract()).andReturn(serviceContract);
@@ -135,6 +136,7 @@
OutboundInvocationChainImpl outChain = new OutboundInvocationChainImpl(operation1);
outChainsMap.put(operation1, outChain);
+ expect(inboundWire.getServiceContract()).andReturn(serviceContract);
expect(inboundWire.getContainer()).andReturn(componentExtn).anyTimes();
expect(outboundWire.getContainer()).andReturn(componentExtn).anyTimes();
expect(inboundWire.getServiceContract()).andReturn(serviceContract);
@@ -181,6 +183,7 @@
OutboundInvocationChainImpl outChain = new OutboundInvocationChainImpl(operation1);
outChainsMap.put(operation1, outChain);
+ expect(inboundWire.getServiceContract()).andReturn(serviceContract);
expect(inboundWire.getContainer()).andReturn(componentExtn).anyTimes();
expect(outboundWire.getContainer()).andReturn(componentExtn).anyTimes();
expect(inboundWire.getServiceContract()).andReturn(serviceContract);
---------------------------------------------------------------------
To unsubscribe, e-mail: tuscany-commits-unsubscribe@ws.apache.org
For additional commands, e-mail: tuscany-commits-help@ws.apache.org