summaryrefslogtreecommitdiffstats
path: root/sca-java-2.x/trunk/modules/core-spi/src/main/java/org
diff options
context:
space:
mode:
Diffstat (limited to 'sca-java-2.x/trunk/modules/core-spi/src/main/java/org')
-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();
}