Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorslewis2007-03-20 00:13:25 +0000
committerslewis2007-03-20 00:13:25 +0000
commit654a127c652fca043f7439abe8ed345179a846c8 (patch)
treeac695f704649437182a56dc873648af53397db27 /examples/bundles/org.eclipse.ecf.example.clients
parent8c515d9571f7e8dac7814d0774d534a456602b87 (diff)
downloadorg.eclipse.ecf-654a127c652fca043f7439abe8ed345179a846c8.tar.gz
org.eclipse.ecf-654a127c652fca043f7439abe8ed345179a846c8.tar.xz
org.eclipse.ecf-654a127c652fca043f7439abe8ed345179a846c8.zip
Added sending/receiving of xmpp message properties.
Diffstat (limited to 'examples/bundles/org.eclipse.ecf.example.clients')
-rw-r--r--examples/bundles/org.eclipse.ecf.example.clients/src/org/eclipse/ecf/example/clients/applications/ChatSORobotApplication.java6
-rw-r--r--examples/bundles/org.eclipse.ecf.example.clients/src/org/eclipse/ecf/example/clients/applications/TrivialSharedObject.java12
2 files changed, 7 insertions, 11 deletions
diff --git a/examples/bundles/org.eclipse.ecf.example.clients/src/org/eclipse/ecf/example/clients/applications/ChatSORobotApplication.java b/examples/bundles/org.eclipse.ecf.example.clients/src/org/eclipse/ecf/example/clients/applications/ChatSORobotApplication.java
index c9f9c4730..0e9035763 100644
--- a/examples/bundles/org.eclipse.ecf.example.clients/src/org/eclipse/ecf/example/clients/applications/ChatSORobotApplication.java
+++ b/examples/bundles/org.eclipse.ecf.example.clients/src/org/eclipse/ecf/example/clients/applications/ChatSORobotApplication.java
@@ -11,7 +11,6 @@
package org.eclipse.ecf.example.clients.applications;
import org.eclipse.core.runtime.IPlatformRunnable;
-import org.eclipse.ecf.core.identity.ID;
import org.eclipse.ecf.core.identity.IDFactory;
import org.eclipse.ecf.core.sharedobject.ISharedObjectContainer;
import org.eclipse.ecf.core.util.ECFException;
@@ -68,7 +67,7 @@ public class ChatSORobotApplication implements IPlatformRunnable,
client.doConnect(connectTarget, password);
- System.out.println("ECF chat robot connected to: " + connectTarget);
+ System.out.println("ECF so chat robot ("+connectTarget+")");
// Send initial message to target user
client.sendChat(targetIMUser, "Hi, I'm an IM robot");
@@ -79,8 +78,7 @@ public class ChatSORobotApplication implements IPlatformRunnable,
// out-of-band via shared object
while (running && count++ < WAIT_COUNT) {
// Send shared object message
- sharedObject.sendMessageTo(client.createID(targetIMUser), count
- + " hello there");
+ sharedObject.sendMessageTo(connectTarget, client.createID(targetIMUser), "hello");
wait(WAIT_TIME);
}
}
diff --git a/examples/bundles/org.eclipse.ecf.example.clients/src/org/eclipse/ecf/example/clients/applications/TrivialSharedObject.java b/examples/bundles/org.eclipse.ecf.example.clients/src/org/eclipse/ecf/example/clients/applications/TrivialSharedObject.java
index 436328a8f..c9eee7f7d 100644
--- a/examples/bundles/org.eclipse.ecf.example.clients/src/org/eclipse/ecf/example/clients/applications/TrivialSharedObject.java
+++ b/examples/bundles/org.eclipse.ecf.example.clients/src/org/eclipse/ecf/example/clients/applications/TrivialSharedObject.java
@@ -27,10 +27,10 @@ public class TrivialSharedObject extends BaseSharedObject {
super.initialize();
}
- public void sendMessageTo(ID targetID, String message) {
+ public void sendMessageTo(String from, ID targetID, String message) {
try {
super.sendSharedObjectMsgTo(targetID, SharedObjectMsg.createMsg(
- null, "handleMessage", message));
+ null, "handleMessage", from, message));
} catch (IOException e) {
e.printStackTrace();
}
@@ -45,11 +45,9 @@ public class TrivialSharedObject extends BaseSharedObject {
return false;
}
- protected void handleMessage(String message) {
- // XXX this should call the view back to display the message/do other
- // things, etc
- System.out
- .println("TrivialSharedObject.handleMessage(" + message + ")");
+ protected void handleMessage(String from, String message) {
+ System.out.println("SharedObject.handleMessage(from="
+ + from + ",msg=" + message + ")");
}
}

Back to the top