Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorslewis2007-05-17 05:58:32 +0000
committerslewis2007-05-17 05:58:32 +0000
commit2bc0bd8235b62744c85c93ce5c7747e9fc6f1044 (patch)
treee69501dce0b80a887681e4f9fcf427847c75f361
parentfc31489a5301e7a81cdafeea1875892d6e2204d2 (diff)
downloadorg.eclipse.ecf-2bc0bd8235b62744c85c93ce5c7747e9fc6f1044.tar.gz
org.eclipse.ecf-2bc0bd8235b62744c85c93ce5c7747e9fc6f1044.tar.xz
org.eclipse.ecf-2bc0bd8235b62744c85c93ce5c7747e9fc6f1044.zip
More refactoring of the org.eclipse.ecf.example.collab plugin
-rw-r--r--examples/bundles/org.eclipse.ecf.example.collab/src/org/eclipse/ecf/example/collab/share/GenericSharedObject.java18
1 files changed, 4 insertions, 14 deletions
diff --git a/examples/bundles/org.eclipse.ecf.example.collab/src/org/eclipse/ecf/example/collab/share/GenericSharedObject.java b/examples/bundles/org.eclipse.ecf.example.collab/src/org/eclipse/ecf/example/collab/share/GenericSharedObject.java
index 5584c59ea..d442118b4 100644
--- a/examples/bundles/org.eclipse.ecf.example.collab/src/org/eclipse/ecf/example/collab/share/GenericSharedObject.java
+++ b/examples/bundles/org.eclipse.ecf.example.collab/src/org/eclipse/ecf/example/collab/share/GenericSharedObject.java
@@ -315,11 +315,7 @@ public class GenericSharedObject implements ISharedObject {
}
public boolean isServer() {
- ISharedObjectContext context = getContext();
- if (context != null) {
- return getContext().isGroupManager();
- } else
- return false;
+ return getContext().isGroupManager();
}
public void memberAdded(ID member) {
@@ -364,17 +360,14 @@ public class GenericSharedObject implements ISharedObject {
protected void replicate(ID remote) {
try {
// Get current group membership
- ISharedObjectContext context = getContext();
- if (context == null)
- return;
- ID[] group = context.getGroupMemberIDs();
+ ID[] group = getContext().getGroupMemberIDs();
if (group == null || group.length < 1) {
// we're done
return;
}
ReplicaSharedObjectDescription createInfo = getReplicaDescription(remote);
if (createInfo != null)
- context.sendCreate(remote, createInfo);
+ getContext().sendCreate(remote, createInfo);
else
return;
} catch (IOException e) {
@@ -383,10 +376,7 @@ public class GenericSharedObject implements ISharedObject {
}
protected void sendSelf(SharedObjectMsg msg) {
- ISharedObjectContext context = getContext();
- if (context == null)
- return;
- IQueueEnqueue queue = context.getQueue();
+ IQueueEnqueue queue = getContext().getQueue();
try {
queue.enqueue(new RemoteSharedObjectMsgEvent(getID(), getContext()
.getLocalContainerID(), msg));

Back to the top