Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorslewis2005-01-03 03:29:35 +0000
committerslewis2005-01-03 03:29:35 +0000
commit78edb97d94f72f7e5f1a658639ffec393f1b25ce (patch)
tree6aa194ea143a5f1bc5897c6c76d87ace54f25b3c
parentb0385ebf5dc8da31f6611abb2124bad9f6a7298b (diff)
downloadorg.eclipse.ecf-78edb97d94f72f7e5f1a658639ffec393f1b25ce.tar.gz
org.eclipse.ecf-78edb97d94f72f7e5f1a658639ffec393f1b25ce.tar.xz
org.eclipse.ecf-78edb97d94f72f7e5f1a658639ffec393f1b25ce.zip
More org.eclipse.ecf.core.events interfaces/classes. Completed implementation and testing of org.eclipse.ecf.provider implementation
-rw-r--r--framework/bundles/org.eclipse.ecf.provider/src/org/eclipse/ecf/provider/generic/ContainerListener.java38
-rw-r--r--framework/bundles/org.eclipse.ecf.provider/src/org/eclipse/ecf/provider/generic/SOContainer.java30
-rw-r--r--framework/bundles/org.eclipse.ecf.provider/src/org/eclipse/ecf/provider/generic/SOManager.java30
-rw-r--r--framework/bundles/org.eclipse.ecf/src/org/eclipse/ecf/core/ISharedObjectManager.java84
-rw-r--r--framework/bundles/org.eclipse.ecf/src/org/eclipse/ecf/core/events/ISharedObjectContainerDisposeEvent.java16
-rw-r--r--framework/bundles/org.eclipse.ecf/src/org/eclipse/ecf/core/events/ISharedObjectManagerEvent.java12
-rw-r--r--framework/bundles/org.eclipse.ecf/src/org/eclipse/ecf/core/events/SharedObjectActivatedEvent.java4
-rw-r--r--framework/bundles/org.eclipse.ecf/src/org/eclipse/ecf/core/events/SharedObjectContainerDisposeEvent.java37
-rw-r--r--framework/bundles/org.eclipse.ecf/src/org/eclipse/ecf/core/events/SharedObjectManagerAddEvent.java56
-rw-r--r--framework/bundles/org.eclipse.ecf/src/org/eclipse/ecf/core/events/SharedObjectManagerConnectEvent.java49
-rw-r--r--framework/bundles/org.eclipse.ecf/src/org/eclipse/ecf/core/events/SharedObjectManagerCreateEvent.java43
-rw-r--r--framework/bundles/org.eclipse.ecf/src/org/eclipse/ecf/core/events/SharedObjectManagerDisconnectEvent.java41
-rw-r--r--framework/bundles/org.eclipse.ecf/src/org/eclipse/ecf/core/events/SharedObjectManagerRemoveEvent.java42
13 files changed, 421 insertions, 61 deletions
diff --git a/framework/bundles/org.eclipse.ecf.provider/src/org/eclipse/ecf/provider/generic/ContainerListener.java b/framework/bundles/org.eclipse.ecf.provider/src/org/eclipse/ecf/provider/generic/ContainerListener.java
new file mode 100644
index 000000000..ffe85d5d9
--- /dev/null
+++ b/framework/bundles/org.eclipse.ecf.provider/src/org/eclipse/ecf/provider/generic/ContainerListener.java
@@ -0,0 +1,38 @@
+/*******************************************************************************
+ * Copyright (c) 2004 Composent, Inc. and others. 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: Composent, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.eclipse.ecf.provider.generic;
+
+import org.eclipse.ecf.core.ISharedObjectContainerListener;
+import org.eclipse.ecf.core.events.IContainerEvent;
+
+
+class ContainerListener {
+ ISharedObjectContainerListener listener;
+ String filter;
+
+ ContainerListener(ISharedObjectContainerListener l, String filter) {
+ this.listener = l;
+ this.filter = filter;
+ }
+ protected IContainerEvent applyFilter(IContainerEvent evt) {
+ return evt;
+ }
+ protected void handleEvent(IContainerEvent evt) {
+ if (listener != null) {
+ IContainerEvent event = applyFilter(evt);
+ listener.handleEvent(event);
+ }
+ }
+ protected boolean isListener(ISharedObjectContainerListener l) {
+ if (listener == null) return false;
+ if (l == null) return false;
+ if (listener.equals(l)) return true;
+ return false;
+ }
+} \ No newline at end of file
diff --git a/framework/bundles/org.eclipse.ecf.provider/src/org/eclipse/ecf/provider/generic/SOContainer.java b/framework/bundles/org.eclipse.ecf.provider/src/org/eclipse/ecf/provider/generic/SOContainer.java
index 553cdbd0f..788457ad5 100644
--- a/framework/bundles/org.eclipse.ecf.provider/src/org/eclipse/ecf/provider/generic/SOContainer.java
+++ b/framework/bundles/org.eclipse.ecf.provider/src/org/eclipse/ecf/provider/generic/SOContainer.java
@@ -20,6 +20,7 @@ import java.io.ObjectOutputStream;
import java.io.Serializable;
import java.security.AccessController;
import java.security.PrivilegedAction;
+import java.util.Enumeration;
import java.util.Iterator;
import java.util.Map;
import java.util.Vector;
@@ -42,6 +43,7 @@ import org.eclipse.ecf.core.comm.IConnection;
import org.eclipse.ecf.core.comm.ISynchAsynchConnectionEventHandler;
import org.eclipse.ecf.core.comm.SynchConnectionEvent;
import org.eclipse.ecf.core.events.IContainerEvent;
+import org.eclipse.ecf.core.events.SharedObjectContainerDisposeEvent;
import org.eclipse.ecf.core.identity.ID;
import org.eclipse.ecf.core.util.Event;
import org.eclipse.ecf.provider.Trace;
@@ -210,6 +212,7 @@ public abstract class SOContainer implements ISharedObjectContainer {
return processSynch(event);
}
}
+
static Trace debug = Trace.create("container");
public static final String DEFAULT_OBJECT_ARG_KEY = SOContainer.class
.getName()
@@ -248,7 +251,7 @@ public abstract class SOContainer implements ISharedObjectContainer {
*/
public void addListener(ISharedObjectContainerListener l, String filter) {
synchronized (listeners) {
- listeners.add(l);
+ listeners.add(new ContainerListener(l,filter));
}
}
@@ -320,9 +323,10 @@ public abstract class SOContainer implements ISharedObjectContainer {
* @see org.eclipse.ecf.core.ISharedObjectContainer#dispose(long)
*/
public void dispose(long waittime) {
- debug("dispose:" + waittime);
+ debug("dispose(" + waittime+")");
isClosing = true;
- // XXX Notify listeners that we're going away
+ // notify listeners
+ fireContainerEvent(new SharedObjectContainerDisposeEvent(getID()));
// Clear group manager
if (groupManager != null) {
groupManager.removeAllMembers();
@@ -355,8 +359,10 @@ public abstract class SOContainer implements ISharedObjectContainer {
protected void fireContainerEvent(IContainerEvent event) {
synchronized (listeners) {
- for (Iterator i = listeners.iterator(); i.hasNext();)
- ((ISharedObjectContainerListener) i.next()).handleEvent(event);
+ for (Iterator i = listeners.iterator(); i.hasNext();) {
+ ContainerListener l = (ContainerListener) i.next();
+ l.handleEvent(event);
+ }
}
}
@@ -766,11 +772,6 @@ public abstract class SOContainer implements ISharedObjectContainer {
groupManager.moveSharedObjectFromLoadingToActive(wrap);
}
- protected void notifyGroupLeave(ContainerMessage mess) {
- // XXX todo
- debug("notifyGroupLeave(" + mess + ")");
- }
-
protected void notifySharedObjectActivated(ID sharedObjectID) {
groupManager.notifyOthersActivated(sharedObjectID);
}
@@ -820,7 +821,6 @@ public abstract class SOContainer implements ISharedObjectContainer {
debug("processSynch:" + e);
ContainerMessage mess = getObjectFromBytes((byte[]) e.getData());
ID fromID = mess.getFromContainerID();
- notifyGroupLeave(mess);
synchronized (getGroupMembershipLock()) {
memberLeave(fromID, e.getConnection());
}
@@ -841,7 +841,13 @@ public abstract class SOContainer implements ISharedObjectContainer {
*/
public void removeListener(ISharedObjectContainerListener l) {
synchronized (listeners) {
- listeners.remove(l);
+ for(Enumeration e=listeners.elements(); e.hasMoreElements(); ) {
+ ContainerListener list = (ContainerListener) e.nextElement();
+ if (list.isListener(l)) {
+ // found it...so remove
+ listeners.remove(list);
+ }
+ }
}
}
diff --git a/framework/bundles/org.eclipse.ecf.provider/src/org/eclipse/ecf/provider/generic/SOManager.java b/framework/bundles/org.eclipse.ecf.provider/src/org/eclipse/ecf/provider/generic/SOManager.java
index 5a134ace0..71c6a8282 100644
--- a/framework/bundles/org.eclipse.ecf.provider/src/org/eclipse/ecf/provider/generic/SOManager.java
+++ b/framework/bundles/org.eclipse.ecf.provider/src/org/eclipse/ecf/provider/generic/SOManager.java
@@ -32,6 +32,12 @@ import org.eclipse.ecf.core.SharedObjectConnectException;
import org.eclipse.ecf.core.SharedObjectCreateException;
import org.eclipse.ecf.core.SharedObjectDescription;
import org.eclipse.ecf.core.SharedObjectDisconnectException;
+import org.eclipse.ecf.core.events.SharedObjectActivatedEvent;
+import org.eclipse.ecf.core.events.SharedObjectManagerAddEvent;
+import org.eclipse.ecf.core.events.SharedObjectManagerConnectEvent;
+import org.eclipse.ecf.core.events.SharedObjectManagerCreateEvent;
+import org.eclipse.ecf.core.events.SharedObjectManagerDisconnectEvent;
+import org.eclipse.ecf.core.events.SharedObjectManagerRemoveEvent;
import org.eclipse.ecf.core.identity.ID;
import org.eclipse.ecf.core.util.AbstractFactory;
import org.eclipse.ecf.core.util.QueueEnqueue;
@@ -142,15 +148,18 @@ public class SOManager implements ISharedObjectManager {
ISharedObjectContainerTransaction trans)
throws SharedObjectCreateException {
debug("createSharedObject(" + sd + "," + trans + ")");
+ // notify listeners
+ container.fireContainerEvent(new SharedObjectManagerCreateEvent(container.getID(),sd));
ISharedObject newObject = null;
Throwable t = null;
ID result = sd.getID();
try {
newObject = loadSharedObject(sd);
- return addSharedObject(result, newObject, sd.getProperties(), trans);
+ result = addSharedObject(sd.getID(), newObject, sd.getProperties(), trans);
} catch (Exception e) {
- throw new SharedObjectCreateException(t);
+ throw new SharedObjectCreateException("Container "+container.getID()+" had exception creating shared object "+sd.getID(),t);
}
+ return result;
}
/*
@@ -165,6 +174,8 @@ public class SOManager implements ISharedObjectManager {
throws SharedObjectAddException {
debug("addSharedObject(" + sharedObjectID + "," + sharedObject + ","
+ properties + "," + trans + ")");
+ // notify listeners
+ container.fireContainerEvent(new SharedObjectManagerAddEvent(container.getID(),sharedObjectID,sharedObject,properties));
Throwable t = null;
ID result = sharedObjectID;
try {
@@ -175,8 +186,10 @@ public class SOManager implements ISharedObjectManager {
properties, 0);
container.addSharedObjectAndWait(sd, so, trans);
} catch (Exception except) {
- throw new SharedObjectAddException(except);
+ throw new SharedObjectAddException("Container "+container.getID()+" had exception adding shared object "+sharedObjectID,except);
}
+ // notify listeners
+ container.fireContainerEvent(new SharedObjectActivatedEvent(container.getID(), result, container.getGroupMemberIDs()));
return result;
}
@@ -196,7 +209,9 @@ public class SOManager implements ISharedObjectManager {
* @see org.eclipse.ecf.core.ISharedObjectManager#removeSharedObject(org.eclipse.ecf.core.identity.ID)
*/
public ISharedObject removeSharedObject(ID sharedObjectID) {
- debug("getSharedObject(" + sharedObjectID + ")");
+ debug("removeSharedObject(" + sharedObjectID + ")");
+ // notify listeners
+ container.fireContainerEvent(new SharedObjectManagerRemoveEvent(container.getID(),sharedObjectID));
return container.removeSharedObject(sharedObjectID);
}
@@ -210,6 +225,8 @@ public class SOManager implements ISharedObjectManager {
ID[] sharedObjectsTo) throws SharedObjectConnectException {
debug("connectSharedObjects(" + sharedObjectFrom + ","
+ sharedObjectsTo + ")");
+ // notify listeners
+ container.fireContainerEvent(new SharedObjectManagerConnectEvent(container.getID(),sharedObjectFrom,sharedObjectsTo));
if (sharedObjectFrom == null)
throw new SharedObjectConnectException("sender cannot be null");
if (sharedObjectsTo == null)
@@ -243,8 +260,11 @@ public class SOManager implements ISharedObjectManager {
*/
public void disconnectSharedObjects(ISharedObjectConnector connector)
throws SharedObjectDisconnectException {
- if (connector != null)
+ if (connector != null) {
debug("disconnectSharedObjects(" + connector.getSender() + ")");
+ // notify listeners
+ container.fireContainerEvent(new SharedObjectManagerDisconnectEvent(container.getID(),connector.getSender()));
+ }
if (connector == null)
throw new SharedObjectDisconnectException("connect cannot be null");
if (!removeConnector(connector)) {
diff --git a/framework/bundles/org.eclipse.ecf/src/org/eclipse/ecf/core/ISharedObjectManager.java b/framework/bundles/org.eclipse.ecf/src/org/eclipse/ecf/core/ISharedObjectManager.java
index 143f79a85..8e7f7f27a 100644
--- a/framework/bundles/org.eclipse.ecf/src/org/eclipse/ecf/core/ISharedObjectManager.java
+++ b/framework/bundles/org.eclipse.ecf/src/org/eclipse/ecf/core/ISharedObjectManager.java
@@ -20,31 +20,6 @@ import org.eclipse.ecf.core.identity.ID;
* @see ISharedObjectContainer#getSharedObjectManager()
*/
public interface ISharedObjectManager {
-
- /**
- * Get the array of SharedObject instances currently contained by this
- * ISharedObjectContainer
- *
- * @return ID[] the IDs of currently contained ISharedObject instances
- */
- public ID[] getSharedObjectIDs();
- /**
- * Create a new ISharedObject within this container from the given
- * SharedObjectDescription.
- *
- * @param sd
- * the SharedObjectDescription that describes the SharedObject to
- * be created
- * @param trans
- * the transaction governing the creation of the shared object.
- * If null, creation will not be transactional
- * @return ID the sharedObjectID of the added ISharedObject
- * @throws SharedObjectCreateException
- * if the SharedObject cannot be created
- */
- public ID createSharedObject(SharedObjectDescription sd,
- ISharedObjectContainerTransaction trans)
- throws SharedObjectCreateException;
/**
* Add an ISharedObject to this container.
*
@@ -64,23 +39,6 @@ public interface ISharedObjectManager {
public ID addSharedObject(ID sharedObjectID, ISharedObject sharedObject,
Map properties, ISharedObjectContainerTransaction trans)
throws SharedObjectAddException;
-
- /**
- * Get the ISharedObject instance corresponding to the given sharedObjectID.
- *
- * @param sharedObjectID
- * of the desired ISharedObject
- * @return ISharedObject found. Return null if ISharedObject not found.
- */
- public ISharedObject getSharedObject(ID sharedObjectID);
- /**
- * Remove the given sharedObjectID from this ISharedObjectContainer.
- *
- * @param sharedObjectID
- * the ID of the ISharedObject to remove
- * @return ISharedObject removed. Returns null if ISharedObject not found
- */
- public ISharedObject removeSharedObject(ID sharedObjectID);
/**
* Create an ISharedObjectConnector instance for sending messages from a
* single ISharedObject to one or more receiver ISharedObjects. All
@@ -100,6 +58,23 @@ public interface ISharedObjectManager {
public ISharedObjectConnector connectSharedObjects(ID sharedObjectFrom,
ID[] sharedObjectsTo) throws SharedObjectConnectException;
/**
+ * Create a new ISharedObject within this container from the given
+ * SharedObjectDescription.
+ *
+ * @param sd
+ * the SharedObjectDescription that describes the SharedObject to
+ * be created
+ * @param trans
+ * the transaction governing the creation of the shared object.
+ * If null, creation will not be transactional
+ * @return ID the sharedObjectID of the added ISharedObject
+ * @throws SharedObjectCreateException
+ * if the SharedObject cannot be created
+ */
+ public ID createSharedObject(SharedObjectDescription sd,
+ ISharedObjectContainerTransaction trans)
+ throws SharedObjectCreateException;
+ /**
* Destroy an ISharedObjectConnector instance.
*
* @param connector
@@ -110,6 +85,15 @@ public interface ISharedObjectManager {
*/
public void disconnectSharedObjects(ISharedObjectConnector connector)
throws SharedObjectDisconnectException;
+
+ /**
+ * Get the ISharedObject instance corresponding to the given sharedObjectID.
+ *
+ * @param sharedObjectID
+ * of the desired ISharedObject
+ * @return ISharedObject found. Return null if ISharedObject not found.
+ */
+ public ISharedObject getSharedObject(ID sharedObjectID);
/**
* Get the sharedObjectConnectors associated with the given sharedObjectID
@@ -117,4 +101,20 @@ public interface ISharedObjectManager {
* @return List of ISharedObjectConnector instances
*/
public List getSharedObjectConnectors(ID sharedObjectFrom);
+
+ /**
+ * Get the array of SharedObject instances currently contained by this
+ * ISharedObjectContainer
+ *
+ * @return ID[] the IDs of currently contained ISharedObject instances
+ */
+ public ID[] getSharedObjectIDs();
+ /**
+ * Remove the given sharedObjectID from this ISharedObjectContainer.
+ *
+ * @param sharedObjectID
+ * the ID of the ISharedObject to remove
+ * @return ISharedObject removed. Returns null if ISharedObject not found
+ */
+ public ISharedObject removeSharedObject(ID sharedObjectID);
}
diff --git a/framework/bundles/org.eclipse.ecf/src/org/eclipse/ecf/core/events/ISharedObjectContainerDisposeEvent.java b/framework/bundles/org.eclipse.ecf/src/org/eclipse/ecf/core/events/ISharedObjectContainerDisposeEvent.java
new file mode 100644
index 000000000..1b1521d8a
--- /dev/null
+++ b/framework/bundles/org.eclipse.ecf/src/org/eclipse/ecf/core/events/ISharedObjectContainerDisposeEvent.java
@@ -0,0 +1,16 @@
+/*******************************************************************************
+ * Copyright (c) 2004 Composent, Inc. and others. 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: Composent, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.eclipse.ecf.core.events;
+
+/**
+ * @author slewis
+ *
+ */
+public interface ISharedObjectContainerDisposeEvent extends IContainerEvent {
+}
diff --git a/framework/bundles/org.eclipse.ecf/src/org/eclipse/ecf/core/events/ISharedObjectManagerEvent.java b/framework/bundles/org.eclipse.ecf/src/org/eclipse/ecf/core/events/ISharedObjectManagerEvent.java
new file mode 100644
index 000000000..1328d9b0b
--- /dev/null
+++ b/framework/bundles/org.eclipse.ecf/src/org/eclipse/ecf/core/events/ISharedObjectManagerEvent.java
@@ -0,0 +1,12 @@
+/*******************************************************************************
+ * Copyright (c) 2004 Composent, Inc. and others. 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: Composent, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.eclipse.ecf.core.events;
+
+public interface ISharedObjectManagerEvent extends IContainerEvent {
+}
diff --git a/framework/bundles/org.eclipse.ecf/src/org/eclipse/ecf/core/events/SharedObjectActivatedEvent.java b/framework/bundles/org.eclipse.ecf/src/org/eclipse/ecf/core/events/SharedObjectActivatedEvent.java
index 5be203642..3eaffaae8 100644
--- a/framework/bundles/org.eclipse.ecf/src/org/eclipse/ecf/core/events/SharedObjectActivatedEvent.java
+++ b/framework/bundles/org.eclipse.ecf/src/org/eclipse/ecf/core/events/SharedObjectActivatedEvent.java
@@ -37,10 +37,10 @@ public class SharedObjectActivatedEvent implements ISharedObjectActivatedEvent {
public String toString() {
StringBuffer sb = new StringBuffer("SharedObjectActivatedEvent[");
- sb.append(getActivatedID()).append(";");
+ sb.append(getLocalContainerID()).append(";");
sb.append(Arrays.asList(getGroupMemberIDs()))
.append(";");
- sb.append(getLocalContainerID()).append("]");
+ sb.append(getActivatedID()).append("]");
return sb.toString();
}
} \ No newline at end of file
diff --git a/framework/bundles/org.eclipse.ecf/src/org/eclipse/ecf/core/events/SharedObjectContainerDisposeEvent.java b/framework/bundles/org.eclipse.ecf/src/org/eclipse/ecf/core/events/SharedObjectContainerDisposeEvent.java
new file mode 100644
index 000000000..419b66d1c
--- /dev/null
+++ b/framework/bundles/org.eclipse.ecf/src/org/eclipse/ecf/core/events/SharedObjectContainerDisposeEvent.java
@@ -0,0 +1,37 @@
+/*******************************************************************************
+ * Copyright (c) 2004 Composent, Inc. and others. 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: Composent, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.eclipse.ecf.core.events;
+
+import org.eclipse.ecf.core.identity.ID;
+
+public class SharedObjectContainerDisposeEvent implements
+ ISharedObjectContainerDisposeEvent {
+ private final ID localContainerID;
+
+ public SharedObjectContainerDisposeEvent(ID container) {
+ super();
+ this.localContainerID = container;
+ }
+
+ public ID getLocalContainerID() {
+ return localContainerID;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see java.lang.Object#toString()
+ */
+ public String toString() {
+ StringBuffer buf = new StringBuffer(
+ "SharedObjectContainerDisposeEvent[");
+ buf.append(getLocalContainerID()).append("]");
+ return buf.toString();
+ }
+} \ No newline at end of file
diff --git a/framework/bundles/org.eclipse.ecf/src/org/eclipse/ecf/core/events/SharedObjectManagerAddEvent.java b/framework/bundles/org.eclipse.ecf/src/org/eclipse/ecf/core/events/SharedObjectManagerAddEvent.java
new file mode 100644
index 000000000..da0033dcf
--- /dev/null
+++ b/framework/bundles/org.eclipse.ecf/src/org/eclipse/ecf/core/events/SharedObjectManagerAddEvent.java
@@ -0,0 +1,56 @@
+/*******************************************************************************
+ * Copyright (c) 2004 Composent, Inc. and others. 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: Composent, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.eclipse.ecf.core.events;
+
+import java.util.Map;
+import org.eclipse.ecf.core.ISharedObject;
+import org.eclipse.ecf.core.identity.ID;
+
+/**
+ * @author slewis
+ *
+ */
+public class SharedObjectManagerAddEvent implements
+ ISharedObjectManagerEvent {
+
+ ID localContainerID = null;
+ Map properties = null;
+ ISharedObject sharedObject = null;
+ ID sharedObjectID = null;
+
+ public SharedObjectManagerAddEvent(ID localContainerID, ID sharedObjectID, ISharedObject object, Map properties) {
+ this.localContainerID = localContainerID;
+ this.sharedObjectID = sharedObjectID;
+ this.sharedObject = object;
+ this.properties = properties;
+ }
+ /* (non-Javadoc)
+ * @see org.eclipse.ecf.core.events.IContainerEvent#getLocalContainerID()
+ */
+ public ID getLocalContainerID() {
+ return localContainerID;
+ }
+ public Map getProperties() {
+ return properties;
+ }
+ public ISharedObject getSharedObject() {
+ return sharedObject;
+ }
+ public ID getSharedObjectID() {
+ return sharedObjectID;
+ }
+ public String toString() {
+ StringBuffer buf = new StringBuffer("SharedObjectManagerAddEvent[");
+ buf.append(getLocalContainerID()).append(";");
+ buf.append(getSharedObjectID()).append(";");
+ buf.append(getSharedObject()).append(";");
+ buf.append(getProperties()).append("]");
+ return buf.toString();
+ }
+}
diff --git a/framework/bundles/org.eclipse.ecf/src/org/eclipse/ecf/core/events/SharedObjectManagerConnectEvent.java b/framework/bundles/org.eclipse.ecf/src/org/eclipse/ecf/core/events/SharedObjectManagerConnectEvent.java
new file mode 100644
index 000000000..618ac2529
--- /dev/null
+++ b/framework/bundles/org.eclipse.ecf/src/org/eclipse/ecf/core/events/SharedObjectManagerConnectEvent.java
@@ -0,0 +1,49 @@
+/*******************************************************************************
+ * Copyright (c) 2004 Composent, Inc. and others. 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: Composent, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.eclipse.ecf.core.events;
+
+import java.util.Arrays;
+import org.eclipse.ecf.core.identity.ID;
+
+/**
+ * @author slewis
+ *
+ */
+public class SharedObjectManagerConnectEvent implements
+ ISharedObjectManagerEvent {
+ ID localContainerID = null;
+ ID [] sharedObjectReceiverIDs = null;
+
+ ID sharedObjectSenderID = null;
+
+ public SharedObjectManagerConnectEvent(ID localContainerID, ID sharedObjectSenderID, ID [] sharedObjectReceiverIDs) {
+ this.localContainerID = localContainerID;
+ this.sharedObjectSenderID = sharedObjectSenderID;
+ this.sharedObjectReceiverIDs = sharedObjectReceiverIDs;
+ }
+ /* (non-Javadoc)
+ * @see org.eclipse.ecf.core.events.IContainerEvent#getLocalContainerID()
+ */
+ public ID getLocalContainerID() {
+ return localContainerID;
+ }
+ public ID[] getSharedObjectReceiverIDs() {
+ return sharedObjectReceiverIDs;
+ }
+ public ID getSharedObjectSenderID() {
+ return sharedObjectSenderID;
+ }
+ public String toString() {
+ StringBuffer buf = new StringBuffer("SharedObjectManagerConnectEvent[");
+ buf.append(getLocalContainerID()).append(";");
+ buf.append(getSharedObjectSenderID()).append(";");
+ buf.append(Arrays.asList(getSharedObjectReceiverIDs())).append("]");
+ return buf.toString();
+ }
+}
diff --git a/framework/bundles/org.eclipse.ecf/src/org/eclipse/ecf/core/events/SharedObjectManagerCreateEvent.java b/framework/bundles/org.eclipse.ecf/src/org/eclipse/ecf/core/events/SharedObjectManagerCreateEvent.java
new file mode 100644
index 000000000..a9cb451de
--- /dev/null
+++ b/framework/bundles/org.eclipse.ecf/src/org/eclipse/ecf/core/events/SharedObjectManagerCreateEvent.java
@@ -0,0 +1,43 @@
+/*******************************************************************************
+ * Copyright (c) 2004 Composent, Inc. and others. 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: Composent, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.eclipse.ecf.core.events;
+
+import org.eclipse.ecf.core.SharedObjectDescription;
+import org.eclipse.ecf.core.identity.ID;
+
+/**
+ * @author slewis
+ *
+ */
+public class SharedObjectManagerCreateEvent implements
+ ISharedObjectManagerEvent {
+
+ SharedObjectDescription description = null;
+ ID localContainerID = null;
+
+ public SharedObjectManagerCreateEvent(ID localContainerID, SharedObjectDescription description) {
+ this.localContainerID = localContainerID;
+ this.description = description;
+ }
+ /* (non-Javadoc)
+ * @see org.eclipse.ecf.core.events.IContainerEvent#getLocalContainerID()
+ */
+ public ID getLocalContainerID() {
+ return localContainerID;
+ }
+ public SharedObjectDescription getDescription() {
+ return description;
+ }
+ public String toString() {
+ StringBuffer buf = new StringBuffer("SharedObjectManagerCreateEvent[");
+ buf.append(getLocalContainerID()).append(";");
+ buf.append(getDescription()).append("]");
+ return buf.toString();
+ }
+}
diff --git a/framework/bundles/org.eclipse.ecf/src/org/eclipse/ecf/core/events/SharedObjectManagerDisconnectEvent.java b/framework/bundles/org.eclipse.ecf/src/org/eclipse/ecf/core/events/SharedObjectManagerDisconnectEvent.java
new file mode 100644
index 000000000..2d4ede045
--- /dev/null
+++ b/framework/bundles/org.eclipse.ecf/src/org/eclipse/ecf/core/events/SharedObjectManagerDisconnectEvent.java
@@ -0,0 +1,41 @@
+/*******************************************************************************
+ * Copyright (c) 2004 Composent, Inc. and others. 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: Composent, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.eclipse.ecf.core.events;
+
+import org.eclipse.ecf.core.identity.ID;
+
+/**
+ * @author slewis
+ *
+ */
+public class SharedObjectManagerDisconnectEvent implements
+ ISharedObjectManagerEvent {
+ ID localContainerID = null;
+ ID sharedObjectSenderID = null;
+
+ public SharedObjectManagerDisconnectEvent(ID localContainerID, ID sharedObjectSenderID) {
+ this.localContainerID = localContainerID;
+ this.sharedObjectSenderID = sharedObjectSenderID;
+ }
+ /* (non-Javadoc)
+ * @see org.eclipse.ecf.core.events.IContainerEvent#getLocalContainerID()
+ */
+ public ID getLocalContainerID() {
+ return localContainerID;
+ }
+ public ID getSharedObjectSenderID() {
+ return sharedObjectSenderID;
+ }
+ public String toString() {
+ StringBuffer buf = new StringBuffer("SharedObjectManagerDisconnectEvent[");
+ buf.append(getLocalContainerID()).append(";");
+ buf.append(getSharedObjectSenderID()).append(";");
+ return buf.toString();
+ }
+}
diff --git a/framework/bundles/org.eclipse.ecf/src/org/eclipse/ecf/core/events/SharedObjectManagerRemoveEvent.java b/framework/bundles/org.eclipse.ecf/src/org/eclipse/ecf/core/events/SharedObjectManagerRemoveEvent.java
new file mode 100644
index 000000000..e78f8683c
--- /dev/null
+++ b/framework/bundles/org.eclipse.ecf/src/org/eclipse/ecf/core/events/SharedObjectManagerRemoveEvent.java
@@ -0,0 +1,42 @@
+/*******************************************************************************
+ * Copyright (c) 2004 Composent, Inc. and others. 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: Composent, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.eclipse.ecf.core.events;
+
+import org.eclipse.ecf.core.identity.ID;
+
+/**
+ * @author slewis
+ *
+ */
+public class SharedObjectManagerRemoveEvent implements
+ ISharedObjectManagerEvent {
+
+ ID sharedObjectID = null;
+ ID localContainerID = null;
+
+ public SharedObjectManagerRemoveEvent(ID localContainerID, ID sharedObjectID) {
+ this.localContainerID = localContainerID;
+ this.sharedObjectID = sharedObjectID;
+ }
+ /* (non-Javadoc)
+ * @see org.eclipse.ecf.core.events.IContainerEvent#getLocalContainerID()
+ */
+ public ID getLocalContainerID() {
+ return localContainerID;
+ }
+ public ID getSharedObjectID() {
+ return sharedObjectID;
+ }
+ public String toString() {
+ StringBuffer buf = new StringBuffer("SharedObjectManagerRemoveEvent[");
+ buf.append(getLocalContainerID()).append(";");
+ buf.append(getSharedObjectID()).append("]");
+ return buf.toString();
+ }
+}

Back to the top