summaryrefslogtreecommitdiffstats
path: root/branches/sca-java-1.x/modules/binding-sca/src/main/java/org
diff options
context:
space:
mode:
Diffstat (limited to 'branches/sca-java-1.x/modules/binding-sca/src/main/java/org')
-rw-r--r--branches/sca-java-1.x/modules/binding-sca/src/main/java/org/apache/tuscany/sca/binding/sca/impl/RuntimeSCAReferenceBindingProvider.java18
1 files changed, 17 insertions, 1 deletions
diff --git a/branches/sca-java-1.x/modules/binding-sca/src/main/java/org/apache/tuscany/sca/binding/sca/impl/RuntimeSCAReferenceBindingProvider.java b/branches/sca-java-1.x/modules/binding-sca/src/main/java/org/apache/tuscany/sca/binding/sca/impl/RuntimeSCAReferenceBindingProvider.java
index 850fd77e96..fa5a9b062b 100644
--- a/branches/sca-java-1.x/modules/binding-sca/src/main/java/org/apache/tuscany/sca/binding/sca/impl/RuntimeSCAReferenceBindingProvider.java
+++ b/branches/sca-java-1.x/modules/binding-sca/src/main/java/org/apache/tuscany/sca/binding/sca/impl/RuntimeSCAReferenceBindingProvider.java
@@ -126,7 +126,7 @@ public class RuntimeSCAReferenceBindingProvider implements ReferenceBindingProvi
private ReferenceBindingProvider getDistributedProvider() {
- if (isTargetRemote()) {
+ if (isTargetRemote() || isRemotableCallback()) {
// initialize the remote provider if it hasn't been done already
if (distributedProvider == null) {
if (reference.getInterfaceContract() != null && !reference.getInterfaceContract().getInterface().isRemotable()) {
@@ -155,6 +155,22 @@ public class RuntimeSCAReferenceBindingProvider implements ReferenceBindingProvi
return distributedProvider;
}
+ /*
+ * This test is needed to make sure the distributed binding provider
+ * is started and stopped if this is a callback binding that might
+ * need to make a remote invocation.
+ */
+ private boolean isRemotableCallback() {
+ if (reference.isCallback() &&
+ reference.getInterfaceContract() != null &&
+ reference.getInterfaceContract().getInterface().isRemotable() &&
+ distributedProviderFactory != null) {
+ return true;
+ } else {
+ return false;
+ }
+ }
+
public InterfaceContract getBindingInterfaceContract() {
if (isTargetRemote()) {
return getDistributedProvider().getBindingInterfaceContract();