summaryrefslogtreecommitdiffstats
path: root/sca-java-2.x/contrib
diff options
context:
space:
mode:
authorfmoga <fmoga@13f79535-47bb-0310-9956-ffa450edef68>2011-05-26 06:14:24 +0000
committerfmoga <fmoga@13f79535-47bb-0310-9956-ffa450edef68>2011-05-26 06:14:24 +0000
commit853b532f1137cf026a0c33e0cc3a49b3d090d271 (patch)
treedf7aab92dbae249c91ce37f97507781e428197b8 /sca-java-2.x/contrib
parentb8a11d3ca54f4b1c1566fe2b1f6cd71544ca1e7e (diff)
Add a few comments to the chat sample.
git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@1127793 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'sca-java-2.x/contrib')
-rw-r--r--sca-java-2.x/contrib/samples/learning-more/binding-comet/chat-webapp/src/main/java/org/apache/tuscany/sca/sample/comet/ChatService.java5
-rw-r--r--sca-java-2.x/contrib/samples/learning-more/binding-comet/chat-webapp/src/main/java/org/apache/tuscany/sca/sample/comet/ChatServiceImpl.java2
2 files changed, 6 insertions, 1 deletions
diff --git a/sca-java-2.x/contrib/samples/learning-more/binding-comet/chat-webapp/src/main/java/org/apache/tuscany/sca/sample/comet/ChatService.java b/sca-java-2.x/contrib/samples/learning-more/binding-comet/chat-webapp/src/main/java/org/apache/tuscany/sca/sample/comet/ChatService.java
index 4c35e1c5e3..fbff379a52 100644
--- a/sca-java-2.x/contrib/samples/learning-more/binding-comet/chat-webapp/src/main/java/org/apache/tuscany/sca/sample/comet/ChatService.java
+++ b/sca-java-2.x/contrib/samples/learning-more/binding-comet/chat-webapp/src/main/java/org/apache/tuscany/sca/sample/comet/ChatService.java
@@ -2,14 +2,17 @@ package org.apache.tuscany.sca.sample.comet;
import org.apache.tuscany.sca.binding.comet.runtime.callback.CometCallback;
import org.oasisopen.sca.annotation.Callback;
+import org.oasisopen.sca.annotation.OneWay;
import org.oasisopen.sca.annotation.Remotable;
@Callback(CometCallback.class)
@Remotable
public interface ChatService {
+ @OneWay
void register();
-
+
+ @OneWay
void postMessage(String user, String message);
}
diff --git a/sca-java-2.x/contrib/samples/learning-more/binding-comet/chat-webapp/src/main/java/org/apache/tuscany/sca/sample/comet/ChatServiceImpl.java b/sca-java-2.x/contrib/samples/learning-more/binding-comet/chat-webapp/src/main/java/org/apache/tuscany/sca/sample/comet/ChatServiceImpl.java
index b58de00035..f54da62f90 100644
--- a/sca-java-2.x/contrib/samples/learning-more/binding-comet/chat-webapp/src/main/java/org/apache/tuscany/sca/sample/comet/ChatServiceImpl.java
+++ b/sca-java-2.x/contrib/samples/learning-more/binding-comet/chat-webapp/src/main/java/org/apache/tuscany/sca/sample/comet/ChatServiceImpl.java
@@ -31,6 +31,8 @@ public class ChatServiceImpl implements ChatService {
@Override
public void register() {
+ // saving the callback object during register() method so it will push data back to the client
+ // using the callback method defined for the register operation in the js when used
clients.add(context.getRequestContext().<CometCallback> getCallback());
}
}