Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorslewis2005-02-22 07:21:31 +0000
committerslewis2005-02-22 07:21:31 +0000
commit7118eb889e62cef81564369d7efaabbb2219f071 (patch)
tree9889d00cc5ec5cae8cbba6bd92349367e733db46
parentc5c04e2159deb94e872c2debd623e155e3c3e291 (diff)
downloadorg.eclipse.ecf-7118eb889e62cef81564369d7efaabbb2219f071.tar.gz
org.eclipse.ecf-7118eb889e62cef81564369d7efaabbb2219f071.tar.xz
org.eclipse.ecf-7118eb889e62cef81564369d7efaabbb2219f071.zip
Added utility methods in ClientSOContainer to allow subclasses to access lock objects. Removed clearing of listener Vector upon dispose(), so that code that is called within listener can call ISharedObjectContainer.dispose()
-rw-r--r--framework/bundles/org.eclipse.ecf.provider/src/org/eclipse/ecf/provider/generic/ClientSOContainer.java25
-rw-r--r--framework/bundles/org.eclipse.ecf.provider/src/org/eclipse/ecf/provider/generic/SOContainer.java4
2 files changed, 17 insertions, 12 deletions
diff --git a/framework/bundles/org.eclipse.ecf.provider/src/org/eclipse/ecf/provider/generic/ClientSOContainer.java b/framework/bundles/org.eclipse.ecf.provider/src/org/eclipse/ecf/provider/generic/ClientSOContainer.java
index 52ab2442e..0ac846b00 100644
--- a/framework/bundles/org.eclipse.ecf.provider/src/org/eclipse/ecf/provider/generic/ClientSOContainer.java
+++ b/framework/bundles/org.eclipse.ecf.provider/src/org/eclipse/ecf/provider/generic/ClientSOContainer.java
@@ -32,11 +32,11 @@ import org.eclipse.ecf.core.identity.ID;
import org.eclipse.ecf.provider.generic.gmm.Member;
public abstract class ClientSOContainer extends SOContainer {
- ISynchAsynchConnection connection;
-
+
+ protected ISynchAsynchConnection connection;
protected ID remoteServerID;
- byte connectionState;
+ protected byte connectionState;
public static final byte UNCONNECTED = 0;
@@ -47,8 +47,14 @@ public abstract class ClientSOContainer extends SOContainer {
static final class Lock {
}
- Lock connectLock;
+ protected Lock connectLock;
+ protected Lock getConnectLock() {
+ return connectLock;
+ }
+ protected ISynchAsynchConnection getConnection() {
+ return connection;
+ }
public ClientSOContainer(ISharedObjectContainerConfig config) {
super(config);
connection = null;
@@ -78,7 +84,9 @@ public abstract class ClientSOContainer extends SOContainer {
}
public ID getGroupID() {
- return remoteServerID;
+ synchronized (getConnectLock()) {
+ return remoteServerID;
+ }
}
public void joinGroup(ID remote, Object data)
@@ -253,8 +261,8 @@ public abstract class ClientSOContainer extends SOContainer {
}
public void leaveGroup() {
- debug("leaveGroup");
ID groupID = getGroupID();
+ debug("leaveGroup:"+groupID);
fireContainerEvent(new SharedObjectContainerLeaveGroupEvent(this
.getID(), groupID));
synchronized (connectLock) {
@@ -269,6 +277,7 @@ public abstract class ClientSOContainer extends SOContainer {
getNextSequenceNumber(),
getLeaveData(groupID))));
} catch (Exception e) {
+ dumpStack("Exception in leaveGroup.sendSynch()",e);
}
synchronized (getGroupMembershipLock()) {
memberLeave(groupID, connection);
@@ -383,13 +392,13 @@ public abstract class ClientSOContainer extends SOContainer {
ID fromID = aPacket.getFromContainerID();
if (fromID == null)
throw new InvalidObjectException("server id is null");
- ID[] ids = ((ContainerMessage.ViewChangeMessage) aPacket.getData()).changeIDs;
+ ID[] ids = ((ContainerMessage.ViewChangeMessage) aPacket.getData()).getChangeIDs();
if (ids == null)
throw new java.io.InvalidObjectException("id array null");
for (int i = 0; i < ids.length; i++) {
ID id = ids[i];
if (id != null && !id.equals(getID())) {
- addNewRemoteMember(id, null);
+ addNewRemoteMember(id, null);
// notify listeners
fireContainerEvent(new SharedObjectContainerJoinedEvent(this
.getID(), id));
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 4ce76e32f..00495c521 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
@@ -392,10 +392,6 @@ public abstract class SOContainer implements ISharedObjectContainer {
loadingThreadGroup.interrupt();
loadingThreadGroup = null;
}
- if (listeners != null) {
- listeners.clear();
- listeners = null;
- }
}
protected void dumpStack(String msg, Throwable e) {

Back to the top