summaryrefslogtreecommitdiffstats
path: root/sca-java-2.x/contrib/modules
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--sca-java-2.x/contrib/modules/binding-comet-runtime/src/main/java/org/apache/tuscany/sca/binding/comet/runtime/CometBindingProviderFactory.java15
-rw-r--r--sca-java-2.x/contrib/modules/binding-comet-runtime/src/main/java/org/apache/tuscany/sca/binding/comet/runtime/CometInvoker.java9
-rw-r--r--sca-java-2.x/contrib/modules/binding-comet-runtime/src/main/java/org/apache/tuscany/sca/binding/comet/runtime/CometReferenceBindingProvider.java11
-rw-r--r--sca-java-2.x/contrib/modules/binding-comet-runtime/src/test/java/org/apache/tuscany/sca/test/CometTest.java3
4 files changed, 37 insertions, 1 deletions
diff --git a/sca-java-2.x/contrib/modules/binding-comet-runtime/src/main/java/org/apache/tuscany/sca/binding/comet/runtime/CometBindingProviderFactory.java b/sca-java-2.x/contrib/modules/binding-comet-runtime/src/main/java/org/apache/tuscany/sca/binding/comet/runtime/CometBindingProviderFactory.java
index 747ea4d78e..6e5cc28abf 100644
--- a/sca-java-2.x/contrib/modules/binding-comet-runtime/src/main/java/org/apache/tuscany/sca/binding/comet/runtime/CometBindingProviderFactory.java
+++ b/sca-java-2.x/contrib/modules/binding-comet-runtime/src/main/java/org/apache/tuscany/sca/binding/comet/runtime/CometBindingProviderFactory.java
@@ -29,10 +29,19 @@ import org.apache.tuscany.sca.provider.ServiceBindingProvider;
import org.apache.tuscany.sca.runtime.RuntimeEndpoint;
import org.apache.tuscany.sca.runtime.RuntimeEndpointReference;
+/**
+ * Factory for binding providers.
+ */
public class CometBindingProviderFactory implements BindingProviderFactory<CometBinding> {
+ /**
+ * Underlying servlet host. Injected by constructor.
+ */
private ServletHost servletHost;
+ /**
+ * Constructor.
+ */
public CometBindingProviderFactory(ExtensionPointRegistry extensionPoints) {
this.servletHost = ServletHostHelper.getServletHost(extensionPoints);
}
@@ -41,10 +50,16 @@ public class CometBindingProviderFactory implements BindingProviderFactory<Comet
return CometBinding.class;
}
+ /**
+ * Creates a provider for a reference that has comet binding specified in the scdl.
+ */
public ReferenceBindingProvider createReferenceBindingProvider(RuntimeEndpointReference endpoint) {
return new CometReferenceBindingProvider(endpoint);
}
+ /**
+ * Creates a provider for a service that has comet binding specified in the scdl.
+ */
public ServiceBindingProvider createServiceBindingProvider(RuntimeEndpoint endpoint) {
return new CometServiceBindingProvider(endpoint, servletHost);
}
diff --git a/sca-java-2.x/contrib/modules/binding-comet-runtime/src/main/java/org/apache/tuscany/sca/binding/comet/runtime/CometInvoker.java b/sca-java-2.x/contrib/modules/binding-comet-runtime/src/main/java/org/apache/tuscany/sca/binding/comet/runtime/CometInvoker.java
index 3b3f9beed3..9a7679ba3b 100644
--- a/sca-java-2.x/contrib/modules/binding-comet-runtime/src/main/java/org/apache/tuscany/sca/binding/comet/runtime/CometInvoker.java
+++ b/sca-java-2.x/contrib/modules/binding-comet-runtime/src/main/java/org/apache/tuscany/sca/binding/comet/runtime/CometInvoker.java
@@ -24,8 +24,12 @@ import org.apache.tuscany.sca.interfacedef.Operation;
import org.apache.tuscany.sca.invocation.Invoker;
import org.apache.tuscany.sca.invocation.Message;
+/**
+ * Invoker for a service binding. Invoking is made from client Javascript so no
+ * behavior is needed.
+ */
public class CometInvoker implements Invoker {
-
+
protected Operation operation;
protected EndpointReference endpoint;
@@ -34,6 +38,9 @@ public class CometInvoker implements Invoker {
this.endpoint = endpoint;
}
+ /**
+ * No behavior.
+ */
public Message invoke(Message msg) {
return null;
}
diff --git a/sca-java-2.x/contrib/modules/binding-comet-runtime/src/main/java/org/apache/tuscany/sca/binding/comet/runtime/CometReferenceBindingProvider.java b/sca-java-2.x/contrib/modules/binding-comet-runtime/src/main/java/org/apache/tuscany/sca/binding/comet/runtime/CometReferenceBindingProvider.java
index 091fc836be..47bdbf9aab 100644
--- a/sca-java-2.x/contrib/modules/binding-comet-runtime/src/main/java/org/apache/tuscany/sca/binding/comet/runtime/CometReferenceBindingProvider.java
+++ b/sca-java-2.x/contrib/modules/binding-comet-runtime/src/main/java/org/apache/tuscany/sca/binding/comet/runtime/CometReferenceBindingProvider.java
@@ -25,6 +25,10 @@ import org.apache.tuscany.sca.interfacedef.Operation;
import org.apache.tuscany.sca.invocation.Invoker;
import org.apache.tuscany.sca.provider.ReferenceBindingProvider;
+/**
+ * Provider for references that have comet binding specified in the scdl.
+ * Not used as comet binding references would occur in client browser's Javascript.
+ */
public class CometReferenceBindingProvider implements ReferenceBindingProvider {
private EndpointReference endpoint;
@@ -32,13 +36,20 @@ public class CometReferenceBindingProvider implements ReferenceBindingProvider {
public CometReferenceBindingProvider(EndpointReference endpoint) {
this.endpoint = endpoint;
}
+
public Invoker createInvoker(Operation operation) {
return new CometInvoker(operation, endpoint);
}
+ /**
+ * No behavior.
+ */
public void start() {
}
+ /**
+ * No behavior.
+ */
public void stop() {
}
diff --git a/sca-java-2.x/contrib/modules/binding-comet-runtime/src/test/java/org/apache/tuscany/sca/test/CometTest.java b/sca-java-2.x/contrib/modules/binding-comet-runtime/src/test/java/org/apache/tuscany/sca/test/CometTest.java
index 9c7fa4323b..4b410d0ea8 100644
--- a/sca-java-2.x/contrib/modules/binding-comet-runtime/src/test/java/org/apache/tuscany/sca/test/CometTest.java
+++ b/sca-java-2.x/contrib/modules/binding-comet-runtime/src/test/java/org/apache/tuscany/sca/test/CometTest.java
@@ -26,6 +26,9 @@ import org.apache.tuscany.sca.node.ContributionLocationHelper;
import org.apache.tuscany.sca.node.Node;
import org.apache.tuscany.sca.node.NodeFactory;
+/**
+ * Test for node startup.
+ */
public class CometTest extends TestCase {
public void testComet() {