summaryrefslogtreecommitdiffstats
path: root/java/sca/modules/implementation-java-runtime/src
diff options
context:
space:
mode:
Diffstat (limited to 'java/sca/modules/implementation-java-runtime/src')
-rw-r--r--java/sca/modules/implementation-java-runtime/src/main/java/org/apache/tuscany/sca/implementation/java/injection/ConversationIDObjectFactory.java3
-rw-r--r--java/sca/modules/implementation-java-runtime/src/main/java/org/apache/tuscany/sca/implementation/java/invocation/JavaCallbackRuntimeWireProcessor.java10
-rw-r--r--java/sca/modules/implementation-java-runtime/src/main/java/org/apache/tuscany/sca/implementation/java/invocation/JavaComponentContextProvider.java4
-rw-r--r--java/sca/modules/implementation-java-runtime/src/main/java/org/apache/tuscany/sca/implementation/java/invocation/JavaImplementationInvoker.java15
4 files changed, 22 insertions, 10 deletions
diff --git a/java/sca/modules/implementation-java-runtime/src/main/java/org/apache/tuscany/sca/implementation/java/injection/ConversationIDObjectFactory.java b/java/sca/modules/implementation-java-runtime/src/main/java/org/apache/tuscany/sca/implementation/java/injection/ConversationIDObjectFactory.java
index ffce7ce467..e8aa178232 100644
--- a/java/sca/modules/implementation-java-runtime/src/main/java/org/apache/tuscany/sca/implementation/java/injection/ConversationIDObjectFactory.java
+++ b/java/sca/modules/implementation-java-runtime/src/main/java/org/apache/tuscany/sca/implementation/java/injection/ConversationIDObjectFactory.java
@@ -33,7 +33,10 @@ public class ConversationIDObjectFactory implements ObjectFactory {
}
public Object getInstance() {
+ /* TODO - EPR - not reqiured for OASIS
return ThreadMessageContext.getMessageContext().getFrom().getReferenceParameters().getConversationID();
+ */
+ return null;
}
}
diff --git a/java/sca/modules/implementation-java-runtime/src/main/java/org/apache/tuscany/sca/implementation/java/invocation/JavaCallbackRuntimeWireProcessor.java b/java/sca/modules/implementation-java-runtime/src/main/java/org/apache/tuscany/sca/implementation/java/invocation/JavaCallbackRuntimeWireProcessor.java
index ef4e67d79a..8ac5d34257 100644
--- a/java/sca/modules/implementation-java-runtime/src/main/java/org/apache/tuscany/sca/implementation/java/invocation/JavaCallbackRuntimeWireProcessor.java
+++ b/java/sca/modules/implementation-java-runtime/src/main/java/org/apache/tuscany/sca/implementation/java/invocation/JavaCallbackRuntimeWireProcessor.java
@@ -23,6 +23,7 @@ import java.util.logging.Level;
import java.util.logging.Logger;
import org.apache.tuscany.sca.assembly.Contract;
+import org.apache.tuscany.sca.assembly.Endpoint2;
import org.apache.tuscany.sca.assembly.Implementation;
import org.apache.tuscany.sca.core.invocation.CallbackInterfaceInterceptor;
import org.apache.tuscany.sca.implementation.java.JavaImplementation;
@@ -33,7 +34,6 @@ import org.apache.tuscany.sca.interfacedef.java.JavaInterface;
import org.apache.tuscany.sca.interfacedef.java.JavaInterfaceFactory;
import org.apache.tuscany.sca.invocation.InvocationChain;
import org.apache.tuscany.sca.invocation.Phase;
-import org.apache.tuscany.sca.runtime.EndpointReference;
import org.apache.tuscany.sca.runtime.RuntimeComponent;
import org.apache.tuscany.sca.runtime.RuntimeComponentReference;
import org.apache.tuscany.sca.runtime.RuntimeWire;
@@ -63,19 +63,19 @@ public class JavaCallbackRuntimeWireProcessor implements RuntimeWireProcessor {
}
private void addCallbackInterfaceInterceptors(RuntimeWire wire) {
- Contract contract = wire.getSource().getContract();
+ Contract contract = wire.getEndpointReference().getReference();
if (!(contract instanceof RuntimeComponentReference)) {
return;
}
- RuntimeComponent component = wire.getSource().getComponent();
+ RuntimeComponent component = (RuntimeComponent) wire.getEndpointReference().getComponent();
Implementation implementation = component.getImplementation();
if (!(implementation instanceof JavaImplementation)) {
return;
}
JavaImplementation javaImpl = (JavaImplementation)implementation;
- EndpointReference callbackEndpoint = wire.getSource().getCallbackEndpoint();
+ Endpoint2 callbackEndpoint = wire.getEndpointReference().getCallbackEndpoint();
if (callbackEndpoint != null) {
- Interface iface = callbackEndpoint.getContract().getInterfaceContract().getInterface();
+ Interface iface = callbackEndpoint.getService().getInterfaceContract().getInterface();
if (!supportsCallbackInterface(iface, javaImpl)) {
// callback to this impl is not possible, so ensure a callback object is set
for (InvocationChain chain : wire.getInvocationChains()) {
diff --git a/java/sca/modules/implementation-java-runtime/src/main/java/org/apache/tuscany/sca/implementation/java/invocation/JavaComponentContextProvider.java b/java/sca/modules/implementation-java-runtime/src/main/java/org/apache/tuscany/sca/implementation/java/invocation/JavaComponentContextProvider.java
index e73fe3a13d..8e90ddb577 100644
--- a/java/sca/modules/implementation-java-runtime/src/main/java/org/apache/tuscany/sca/implementation/java/invocation/JavaComponentContextProvider.java
+++ b/java/sca/modules/implementation-java-runtime/src/main/java/org/apache/tuscany/sca/implementation/java/invocation/JavaComponentContextProvider.java
@@ -149,7 +149,7 @@ public class JavaComponentContextProvider {
if (callbackReference != null) {
List<RuntimeWire> wires = callbackReference.getRuntimeWires();
if (!wires.isEmpty()) {
- callbackWires.put(wires.get(0).getSource().getInterfaceContract().getInterface().toString(),
+ callbackWires.put(wires.get(0).getEndpointReference().getInterfaceContract().getInterface().toString(),
wires);
}
}
@@ -220,7 +220,7 @@ public class JavaComponentContextProvider {
factory =
new CallableReferenceObjectFactory(businessInterface, component,
(RuntimeComponentReference)wireList.get(i)
- .getSource().getContract(), wireList.get(i)
+ .getEndpointReference().getReference(), wireList.get(i)
.getEndpointReference());
} else {
factory = createObjectFactory(baseType, wireList.get(i));
diff --git a/java/sca/modules/implementation-java-runtime/src/main/java/org/apache/tuscany/sca/implementation/java/invocation/JavaImplementationInvoker.java b/java/sca/modules/implementation-java-runtime/src/main/java/org/apache/tuscany/sca/implementation/java/invocation/JavaImplementationInvoker.java
index 60e093d0dc..507ac07b6e 100644
--- a/java/sca/modules/implementation-java-runtime/src/main/java/org/apache/tuscany/sca/implementation/java/invocation/JavaImplementationInvoker.java
+++ b/java/sca/modules/implementation-java-runtime/src/main/java/org/apache/tuscany/sca/implementation/java/invocation/JavaImplementationInvoker.java
@@ -21,8 +21,8 @@ package org.apache.tuscany.sca.implementation.java.invocation;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
+import org.apache.tuscany.sca.assembly.EndpointReference2;
import org.apache.tuscany.sca.core.factory.InstanceWrapper;
-import org.apache.tuscany.sca.core.scope.Scope;
import org.apache.tuscany.sca.core.scope.ScopeContainer;
import org.apache.tuscany.sca.core.scope.ScopedRuntimeComponent;
import org.apache.tuscany.sca.implementation.java.JavaImplementation;
@@ -33,7 +33,6 @@ import org.apache.tuscany.sca.interfacedef.java.impl.JavaInterfaceUtil;
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.runtime.EndpointReference;
import org.apache.tuscany.sca.runtime.ReferenceParameters;
import org.apache.tuscany.sca.runtime.RuntimeComponent;
import org.oasisopen.sca.ServiceRuntimeException;
@@ -77,11 +76,13 @@ public class JavaImplementationInvoker implements Invoker, DataExchangeSemantics
Object contextId = null;
- EndpointReference from = msg.getFrom();
+ EndpointReference2 from = msg.getFrom();
+ /* TODO - EPR - not required for OASIS
ReferenceParameters parameters = null;
if (from != null) {
parameters = from.getReferenceParameters();
}
+
// check what sort of context is required
if (scopeContainer != null) {
Scope scope = scopeContainer.getScope();
@@ -91,6 +92,7 @@ public class JavaImplementationInvoker implements Invoker, DataExchangeSemantics
contextId = parameters.getConversationID();
}
}
+ */
try {
// The following call might create a new conversation, as a result, the msg.getConversationID() might
@@ -104,11 +106,13 @@ public class JavaImplementationInvoker implements Invoker, DataExchangeSemantics
// to get the contextId of this component and remove it after we have invoked the method on
// it. It is possible that the component instance will not go away when it is removed below
// because a callback conversation will still be holding a reference to it
+ /* TODO - EPR - not required for OASIS
boolean removeTemporaryConversationalComponentAfterCall = false;
if (parameters != null && (contextId == null) && (parameters.getConversationID() != null)) {
contextId = parameters.getConversationID();
removeTemporaryConversationalComponentAfterCall = true;
}
+ */
Object instance = wrapper.getInstance();
@@ -134,12 +138,15 @@ public class JavaImplementationInvoker implements Invoker, DataExchangeSemantics
scopeContainer.returnWrapper(wrapper, contextId);
+ /* TODO - EPR - not required for OASIS
if ((sequence == ConversationSequence.CONVERSATION_END) || (removeTemporaryConversationalComponentAfterCall)) {
// if end conversation, or we have the special case where a conversational
// object was created to service the stateless half of a stateful component
scopeContainer.remove(contextId);
parameters.setConversationID(null);
}
+ */
+
msg.setBody(ret);
} catch (InvocationTargetException e) {
Throwable cause = e.getTargetException();
@@ -168,7 +175,9 @@ public class JavaImplementationInvoker implements Invoker, DataExchangeSemantics
if (!isChecked && contextId != null) {
scopeContainer.remove(contextId);
+ /* TODO - EPR - not required for OASIS
parameters.setConversationID(null);
+ */
}
} catch (Exception ex){
// TODO - sure what the best course of action is here. We have