Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorpnehrer2005-02-02 04:34:44 +0000
committerpnehrer2005-02-02 04:34:44 +0000
commitfb4d77d66692e21ffd015a39d9292b36af331de8 (patch)
tree5305f38be76836aaacc421e633ae7ef137abf85e
parentbae574beaf38043afa65d5903299d16220addbd5 (diff)
downloadorg.eclipse.ecf-fb4d77d66692e21ffd015a39d9292b36af331de8.tar.gz
org.eclipse.ecf-fb4d77d66692e21ffd015a39d9292b36af331de8.tar.xz
org.eclipse.ecf-fb4d77d66692e21ffd015a39d9292b36af331de8.zip
One more try...
-rw-r--r--examples/bundles/org.eclipse.ecf.example.sdo.editor/src/org/eclipse/ecf/example/sdo/editor/PublishedGraphTracker.java34
1 files changed, 19 insertions, 15 deletions
diff --git a/examples/bundles/org.eclipse.ecf.example.sdo.editor/src/org/eclipse/ecf/example/sdo/editor/PublishedGraphTracker.java b/examples/bundles/org.eclipse.ecf.example.sdo.editor/src/org/eclipse/ecf/example/sdo/editor/PublishedGraphTracker.java
index c4719808b..648bb97c8 100644
--- a/examples/bundles/org.eclipse.ecf.example.sdo.editor/src/org/eclipse/ecf/example/sdo/editor/PublishedGraphTracker.java
+++ b/examples/bundles/org.eclipse.ecf.example.sdo.editor/src/org/eclipse/ecf/example/sdo/editor/PublishedGraphTracker.java
@@ -173,7 +173,8 @@ class PublishedGraphTracker extends PlatformObject implements ISharedObject {
Integer type = (Integer) data[0];
switch (type.intValue()) {
case JOIN:
- handleJoin(e.getRemoteContainerID(), (String[]) data[1]);
+ handleJoin(e.getRemoteContainerID(),
+ data.length > 2 ? (String[]) data[1] : null);
break;
case LEAVE:
@@ -209,14 +210,18 @@ class PublishedGraphTracker extends PlatformObject implements ISharedObject {
}
private void handleJoin(ID containerID, String[] paths) {
- table.add(containerID, paths);
- try {
- config.getContext().sendMessage(null,
- new Object[] { new Integer(ADD), paths });
- } catch (IOException e) {
- // TODO Auto-generated catch block
- e.printStackTrace();
- }
+ if (paths != null)
+ table.add(containerID, paths);
+
+ paths = table.getPaths(config.getContext().getLocalContainerID());
+ if (paths.length > 0)
+ try {
+ config.getContext().sendMessage(containerID,
+ new Object[] { new Integer(ADD), paths });
+ } catch (IOException e) {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ }
}
private void handleLeave(ID containerID) {
@@ -232,13 +237,12 @@ class PublishedGraphTracker extends PlatformObject implements ISharedObject {
}
private void handleJoined() {
+ String[] paths = table.getPaths(config.getContext()
+ .getLocalContainerID());
+ Object[] data = paths.length == 0 ? new Object[] { new Integer(JOIN) }
+ : new Object[] { new Integer(JOIN), paths };
try {
- config.getContext().sendMessage(
- null,
- new Object[] {
- new Integer(JOIN),
- table.getPaths(config.getContext()
- .getLocalContainerID()) });
+ config.getContext().sendMessage(null, data);
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();

Back to the top