summaryrefslogtreecommitdiffstats
path: root/sca-java-2.x/trunk/modules/core-spi/src/main/java/org/apache/tuscany
diff options
context:
space:
mode:
authorslaws <slaws@13f79535-47bb-0310-9956-ffa450edef68>2010-11-30 09:11:10 +0000
committerslaws <slaws@13f79535-47bb-0310-9956-ffa450edef68>2010-11-30 09:11:10 +0000
commit07ea3bbe7e438fc985c2b7832fb4955543ae218f (patch)
tree54f14811db7e175c17bfd3e6df0a0b47739ffc5e /sca-java-2.x/trunk/modules/core-spi/src/main/java/org/apache/tuscany
parent83a2ce4071731aaba970d24e339bb9fb4823c363 (diff)
TUSCANY-3788, TUSCANY-3786 - Allow build time resolvable references to be resolved then so that async response services can be established at that point. In a reliable situation the response service is then available as soon as reference is resolved and doesn't depend on the reference actually being used. Also start adding interfaces to allow the implementation provider to make an async invocation explicitly.
git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@1040444 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'sca-java-2.x/trunk/modules/core-spi/src/main/java/org/apache/tuscany')
-rw-r--r--sca-java-2.x/trunk/modules/core-spi/src/main/java/org/apache/tuscany/sca/invocation/InvokerAsync.java39
-rw-r--r--sca-java-2.x/trunk/modules/core-spi/src/main/java/org/apache/tuscany/sca/runtime/BaseEndpointRegistry.java1
-rw-r--r--sca-java-2.x/trunk/modules/core-spi/src/main/java/org/apache/tuscany/sca/runtime/EndpointReferenceBinder.java3
-rw-r--r--sca-java-2.x/trunk/modules/core-spi/src/main/java/org/apache/tuscany/sca/runtime/Invocable.java9
-rw-r--r--sca-java-2.x/trunk/modules/core-spi/src/main/java/org/apache/tuscany/sca/runtime/RuntimeEndpointReference.java8
5 files changed, 59 insertions, 1 deletions
diff --git a/sca-java-2.x/trunk/modules/core-spi/src/main/java/org/apache/tuscany/sca/invocation/InvokerAsync.java b/sca-java-2.x/trunk/modules/core-spi/src/main/java/org/apache/tuscany/sca/invocation/InvokerAsync.java
new file mode 100644
index 0000000000..624e8fdab4
--- /dev/null
+++ b/sca-java-2.x/trunk/modules/core-spi/src/main/java/org/apache/tuscany/sca/invocation/InvokerAsync.java
@@ -0,0 +1,39 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.tuscany.sca.invocation;
+
+/**
+ * TUSCANY-3786 - Possibly temporary interface to describe an
+ * async invocation. Need to make it work end to
+ * end before committing to this.
+ *
+ * Asynchronous mediation associated with a client- or target- side wire.
+ *
+ */
+public interface InvokerAsync {
+
+ /**
+ * Process an asynchronous wire
+ *
+ * @param msg The request Message for the wire
+ *
+ */
+ void invokeAsync(Message msg);
+
+}
diff --git a/sca-java-2.x/trunk/modules/core-spi/src/main/java/org/apache/tuscany/sca/runtime/BaseEndpointRegistry.java b/sca-java-2.x/trunk/modules/core-spi/src/main/java/org/apache/tuscany/sca/runtime/BaseEndpointRegistry.java
index 0b6b93edc0..65c1f8815b 100644
--- a/sca-java-2.x/trunk/modules/core-spi/src/main/java/org/apache/tuscany/sca/runtime/BaseEndpointRegistry.java
+++ b/sca-java-2.x/trunk/modules/core-spi/src/main/java/org/apache/tuscany/sca/runtime/BaseEndpointRegistry.java
@@ -60,6 +60,7 @@ public abstract class BaseEndpointRegistry implements EndpointRegistry, LifeCycl
public void addEndpointReference(EndpointReference endpointReference) {
endpointreferences.add(endpointReference);
+ ((RuntimeEndpointReference)endpointReference).bind(registry, this);
logger.fine("Add endpoint reference - " + endpointReference);
}
diff --git a/sca-java-2.x/trunk/modules/core-spi/src/main/java/org/apache/tuscany/sca/runtime/EndpointReferenceBinder.java b/sca-java-2.x/trunk/modules/core-spi/src/main/java/org/apache/tuscany/sca/runtime/EndpointReferenceBinder.java
index b2ce3f5b7b..60f8a5c5a0 100644
--- a/sca-java-2.x/trunk/modules/core-spi/src/main/java/org/apache/tuscany/sca/runtime/EndpointReferenceBinder.java
+++ b/sca-java-2.x/trunk/modules/core-spi/src/main/java/org/apache/tuscany/sca/runtime/EndpointReferenceBinder.java
@@ -20,6 +20,7 @@
package org.apache.tuscany.sca.runtime;
import org.apache.tuscany.sca.assembly.EndpointReference;
+import org.apache.tuscany.sca.assembly.builder.BuilderContext;
/**
* A utility responsible for resolving the endpoint reference against a matching endpoint published
@@ -32,7 +33,7 @@ public interface EndpointReferenceBinder {
* @param endpointReference
* @return
*/
- void bindBuildTime(EndpointRegistry endpointRegistry, EndpointReference endpointReference);
+ void bindBuildTime(EndpointRegistry endpointRegistry, EndpointReference endpointReference, BuilderContext builderContext);
/**
diff --git a/sca-java-2.x/trunk/modules/core-spi/src/main/java/org/apache/tuscany/sca/runtime/Invocable.java b/sca-java-2.x/trunk/modules/core-spi/src/main/java/org/apache/tuscany/sca/runtime/Invocable.java
index 2df1761aec..31260f1afa 100644
--- a/sca-java-2.x/trunk/modules/core-spi/src/main/java/org/apache/tuscany/sca/runtime/Invocable.java
+++ b/sca-java-2.x/trunk/modules/core-spi/src/main/java/org/apache/tuscany/sca/runtime/Invocable.java
@@ -128,6 +128,15 @@ public interface Invocable {
* @throws InvocationTargetException
*/
Message invoke(Operation operation, Message msg);
+
+ /**
+ * Asynchronously invoke an operation with a context message
+ * @param operation The operation
+ * @param msg The request message
+ * @return The ticket that can be used to identify this invocation
+ * @throws InvocationTargetException
+ */
+ void invokeAsync(Operation operation, Message msg);
/**
* Get a list of policy providers
diff --git a/sca-java-2.x/trunk/modules/core-spi/src/main/java/org/apache/tuscany/sca/runtime/RuntimeEndpointReference.java b/sca-java-2.x/trunk/modules/core-spi/src/main/java/org/apache/tuscany/sca/runtime/RuntimeEndpointReference.java
index 42e7328c0a..81ef1acd9e 100644
--- a/sca-java-2.x/trunk/modules/core-spi/src/main/java/org/apache/tuscany/sca/runtime/RuntimeEndpointReference.java
+++ b/sca-java-2.x/trunk/modules/core-spi/src/main/java/org/apache/tuscany/sca/runtime/RuntimeEndpointReference.java
@@ -77,4 +77,12 @@ public interface RuntimeEndpointReference extends EndpointReference, Invocable,
* @return
*/
public InterfaceContract getGeneratedWSDLContract(InterfaceContract interfaceContract);
+
+ /**
+ * Create the endpoint which will be the target of and asynchronous response to a
+ * message sent through this reference. We have the code here as this can't be done
+ * in the builders in the same was as callbacks are because we don't know the details
+ * of the endpoint until the endpoint reference has been resolved.
+ */
+ public void createAsyncCallbackEndpoint();
}