Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorpnehrer2005-04-27 04:23:50 +0000
committerpnehrer2005-04-27 04:23:50 +0000
commit03f151c14b1923630d386dc2e2e26d009d19dbc2 (patch)
tree3147b1ec83de2aedd2fc94543168e043dd1ce4b9
parent380c9c0eea42e77c6952cc06fca85e60998a51c0 (diff)
downloadorg.eclipse.ecf-03f151c14b1923630d386dc2e2e26d009d19dbc2.tar.gz
org.eclipse.ecf-03f151c14b1923630d386dc2e2e26d009d19dbc2.tar.xz
org.eclipse.ecf-03f151c14b1923630d386dc2e2e26d009d19dbc2.zip
Checkpoint.
-rw-r--r--framework/bundles/org.eclipse.ecf.datashare/src/org/eclipse/ecf/internal/datashare/Agent.java9
-rw-r--r--framework/bundles/org.eclipse.ecf.datashare/src/org/eclipse/ecf/internal/datashare/Update.java60
2 files changed, 69 insertions, 0 deletions
diff --git a/framework/bundles/org.eclipse.ecf.datashare/src/org/eclipse/ecf/internal/datashare/Agent.java b/framework/bundles/org.eclipse.ecf.datashare/src/org/eclipse/ecf/internal/datashare/Agent.java
index adfefcb29..e2c6a85be 100644
--- a/framework/bundles/org.eclipse.ecf.datashare/src/org/eclipse/ecf/internal/datashare/Agent.java
+++ b/framework/bundles/org.eclipse.ecf.datashare/src/org/eclipse/ecf/internal/datashare/Agent.java
@@ -18,6 +18,7 @@ import org.eclipse.ecf.core.ISharedObjectConfig;
import org.eclipse.ecf.core.SharedObjectDescription;
import org.eclipse.ecf.core.SharedObjectInitException;
import org.eclipse.ecf.core.events.ISharedObjectActivatedEvent;
+import org.eclipse.ecf.core.events.ISharedObjectMessageEvent;
import org.eclipse.ecf.core.identity.ID;
import org.eclipse.ecf.core.util.ECFException;
import org.eclipse.ecf.core.util.Event;
@@ -98,6 +99,10 @@ public class Agent implements ISharedData, ISharedObject {
ISharedObjectActivatedEvent e = (ISharedObjectActivatedEvent) event;
if (e.getActivatedID().equals(config.getSharedObjectID()))
handleActivated();
+ } else if (event instanceof ISharedObjectMessageEvent) {
+ ISharedObjectMessageEvent e = (ISharedObjectMessageEvent) event;
+ if (e.getData() instanceof Update)
+ handleUpdate((Update) e.getData());
}
bootstrap.handleEvent(event);
@@ -122,6 +127,10 @@ public class Agent implements ISharedData, ISharedObject {
pubCallback = null;
}
}
+
+ private void handleUpdate(Update upate) {
+ // TODO implement me!
+ }
public void doBootstrap(ID containerID) {
// TODO bootstrap the new member
diff --git a/framework/bundles/org.eclipse.ecf.datashare/src/org/eclipse/ecf/internal/datashare/Update.java b/framework/bundles/org.eclipse.ecf.datashare/src/org/eclipse/ecf/internal/datashare/Update.java
new file mode 100644
index 000000000..85579ba98
--- /dev/null
+++ b/framework/bundles/org.eclipse.ecf.datashare/src/org/eclipse/ecf/internal/datashare/Update.java
@@ -0,0 +1,60 @@
+/*******************************************************************************
+ * Copyright (c) 2005 Peter Nehrer and Composent, Inc.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Peter Nehrer - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.ecf.internal.datashare;
+
+import java.io.Serializable;
+
+/**
+ * @author pnehrer
+ */
+public class Update implements Serializable {
+
+ private static final long serialVersionUID = 3256439205344260914L;
+
+ private final Version version;
+
+ private final Object data;
+
+ public Update(Version version, Object data) {
+ this.version = version;
+ this.data = data;
+ }
+
+ public Version getVersion() {
+ return version;
+ }
+
+ public Object getData() {
+ return data;
+ }
+
+ public boolean equals(Object other) {
+ if (other instanceof Update) {
+ Update o = (Update) other;
+ return version.equals(o.version) && data.equals(o.data);
+ } else
+ return false;
+ }
+
+ public int hashCode() {
+ int c = 17;
+ c = 37 * c + version.hashCode();
+ c = 37 * c + data.hashCode();
+ return c;
+ }
+
+ public String toString() {
+ StringBuffer buf = new StringBuffer("Update[");
+ buf.append("version=").append(version).append(";");
+ buf.append("data=").append(data).append("]");
+ return buf.toString();
+ }
+}

Back to the top