Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorslewis2006-07-27 01:24:38 -0400
committerslewis2006-07-27 01:24:38 -0400
commit92409ac34778238e4afc4fcfb110678f70b413ea (patch)
tree974b37cec91364c539e6fc77060d3a6d649c8b83
parent078e95db7d11c630cc8298283419e3c061b36f6e (diff)
downloadorg.eclipse.ecf-92409ac34778238e4afc4fcfb110678f70b413ea.tar.gz
org.eclipse.ecf-92409ac34778238e4afc4fcfb110678f70b413ea.tar.xz
org.eclipse.ecf-92409ac34778238e4afc4fcfb110678f70b413ea.zip
Changed return type of handleSharedObjectMsgEvent method (from Event to boolean). Changed/eliminated all references.
-rw-r--r--examples/bundles/org.eclipse.ecf.example.clients/src/org/eclipse/ecf/example/clients/TrivialSharedObject.java12
-rw-r--r--examples/bundles/org.eclipse.ecf.example.collab/src/org/eclipse/ecf/example/collab/share/RosterSharedObject.java16
-rw-r--r--framework/bundles/org.eclipse.ecf/src/org/eclipse/ecf/core/sharedobject/AbstractSharedObject.java11
-rw-r--r--framework/bundles/org.eclipse.ecf/src/org/eclipse/ecf/core/sharedobject/SharedObjectMsgEventProcessor.java4
-rw-r--r--providers/bundles/org.eclipse.ecf.provider.remoteservice/src/org/eclipse/ecf/provider/remoteservice/generic/RegistrySharedObject.java24
5 files changed, 20 insertions, 47 deletions
diff --git a/examples/bundles/org.eclipse.ecf.example.clients/src/org/eclipse/ecf/example/clients/TrivialSharedObject.java b/examples/bundles/org.eclipse.ecf.example.clients/src/org/eclipse/ecf/example/clients/TrivialSharedObject.java
index d1312d764..b6ebb1074 100644
--- a/examples/bundles/org.eclipse.ecf.example.clients/src/org/eclipse/ecf/example/clients/TrivialSharedObject.java
+++ b/examples/bundles/org.eclipse.ecf.example.clients/src/org/eclipse/ecf/example/clients/TrivialSharedObject.java
@@ -3,12 +3,9 @@ package org.eclipse.ecf.example.clients;
import java.io.IOException;
import org.eclipse.ecf.core.SharedObjectInitException;
-import org.eclipse.ecf.core.events.ISharedObjectMessageEvent;
import org.eclipse.ecf.core.identity.ID;
import org.eclipse.ecf.core.sharedobject.AbstractSharedObject;
import org.eclipse.ecf.core.sharedobject.SharedObjectMsg;
-import org.eclipse.ecf.core.sharedobject.SharedObjectMsgEvent;
-import org.eclipse.ecf.core.util.Event;
public class TrivialSharedObject extends AbstractSharedObject {
@@ -27,17 +24,14 @@ public class TrivialSharedObject extends AbstractSharedObject {
e.printStackTrace();
}
}
-
- protected Event handleSharedObjectMsgEvent(ISharedObjectMessageEvent event) {
+ protected boolean handleSharedObjectMsg(SharedObjectMsg msg) {
try {
- ((SharedObjectMsgEvent) event.getData()).getSharedObjectMsg()
- .invoke(this);
+ msg.invoke(this);
} catch (Exception e) {
e.printStackTrace();
}
- return event;
+ return false;
}
-
protected void handleMessage(String message) {
// XXX this should call the view back to display the message/do other things, etc
System.out.println("TrivialSharedObject.handleMessage(" + message + ")");
diff --git a/examples/bundles/org.eclipse.ecf.example.collab/src/org/eclipse/ecf/example/collab/share/RosterSharedObject.java b/examples/bundles/org.eclipse.ecf.example.collab/src/org/eclipse/ecf/example/collab/share/RosterSharedObject.java
index 8ec1b8b68..cde670793 100644
--- a/examples/bundles/org.eclipse.ecf.example.collab/src/org/eclipse/ecf/example/collab/share/RosterSharedObject.java
+++ b/examples/bundles/org.eclipse.ecf.example.collab/src/org/eclipse/ecf/example/collab/share/RosterSharedObject.java
@@ -2,12 +2,9 @@ package org.eclipse.ecf.example.collab.share;
import java.io.IOException;
-import org.eclipse.ecf.core.events.ISharedObjectMessageEvent;
import org.eclipse.ecf.core.identity.ID;
import org.eclipse.ecf.core.sharedobject.AbstractSharedObject;
import org.eclipse.ecf.core.sharedobject.SharedObjectMsg;
-import org.eclipse.ecf.core.sharedobject.SharedObjectMsgEvent;
-import org.eclipse.ecf.core.util.Event;
import org.eclipse.ecf.example.collab.ui.CollabRosterView;
import org.eclipse.swt.widgets.Display;
import org.eclipse.ui.IWorkbenchPage;
@@ -31,19 +28,14 @@ public class RosterSharedObject extends AbstractSharedObject {
}
}
- protected Event handleSharedObjectMsgEvent(ISharedObjectMessageEvent event) {
- Object data = event.getData();
- SharedObjectMsg m = null;
+ protected boolean handleSharedObjectMsg(SharedObjectMsg msg) {
try {
- if (data instanceof SharedObjectMsg) m = (SharedObjectMsg) data;
- else m = ((SharedObjectMsgEvent) data).getSharedObjectMsg();
- m.invoke(this);
- // We've handled this message, so don't let it go further
- return null;
+ msg.invoke(this);
+ return true;
} catch (Exception e) {
e.printStackTrace();
- return event;
}
+ return false;
}
protected void handleMessage(String message) {
diff --git a/framework/bundles/org.eclipse.ecf/src/org/eclipse/ecf/core/sharedobject/AbstractSharedObject.java b/framework/bundles/org.eclipse.ecf/src/org/eclipse/ecf/core/sharedobject/AbstractSharedObject.java
index b43785eb5..7f23b2c55 100644
--- a/framework/bundles/org.eclipse.ecf/src/org/eclipse/ecf/core/sharedobject/AbstractSharedObject.java
+++ b/framework/bundles/org.eclipse.ecf/src/org/eclipse/ecf/core/sharedobject/AbstractSharedObject.java
@@ -267,17 +267,14 @@ public class AbstractSharedObject implements ISharedObject,
* The SharedObjectMsgEventProcessor is associated with this object via the initialize()
* method
* @param event the event to handle
- * @return Event the Event for subsequent processing. If null, the provided event
- * will receive no further processing. If non-null the provided Event will be
+ * @return true if the provided event should receive no further processing. If false the provided Event should be
* passed to subsequent event processors.
*/
- protected Event handleSharedObjectMsgEvent(ISharedObjectMessageEvent event) {
+ protected boolean handleSharedObjectMsgEvent(ISharedObjectMessageEvent event) {
trace("handleSharedObjectMsgEvent("+event+")");
SharedObjectMsg msg = getSharedObjectMsgFromEvent(event);
- boolean msgResult = false;
- if (msg != null) msgResult = handleSharedObjectMsg(msg);
- if (msgResult) return null;
- else return event;
+ if (msg != null) return handleSharedObjectMsg(msg);
+ else return false;
}
/**
* SharedObjectMsg handler method. This method will be called by {@link #handleSharedObjectMsgEvent(ISharedObjectMessageEvent)} when
diff --git a/framework/bundles/org.eclipse.ecf/src/org/eclipse/ecf/core/sharedobject/SharedObjectMsgEventProcessor.java b/framework/bundles/org.eclipse.ecf/src/org/eclipse/ecf/core/sharedobject/SharedObjectMsgEventProcessor.java
index ffe1a3886..77338bef1 100644
--- a/framework/bundles/org.eclipse.ecf/src/org/eclipse/ecf/core/sharedobject/SharedObjectMsgEventProcessor.java
+++ b/framework/bundles/org.eclipse.ecf/src/org/eclipse/ecf/core/sharedobject/SharedObjectMsgEventProcessor.java
@@ -29,9 +29,9 @@ public class SharedObjectMsgEventProcessor implements IEventProcessor {
}
public boolean processEvent(Event event) {
if (!(event instanceof ISharedObjectMessageEvent)) return false;
- return (processSharedObjectMsgEvent((ISharedObjectMessageEvent) event)==null);
+ return processSharedObjectMsgEvent((ISharedObjectMessageEvent) event);
}
- protected Event processSharedObjectMsgEvent(ISharedObjectMessageEvent event) {
+ protected boolean processSharedObjectMsgEvent(ISharedObjectMessageEvent event) {
return sharedObject.handleSharedObjectMsgEvent(event);
}
}
diff --git a/providers/bundles/org.eclipse.ecf.provider.remoteservice/src/org/eclipse/ecf/provider/remoteservice/generic/RegistrySharedObject.java b/providers/bundles/org.eclipse.ecf.provider.remoteservice/src/org/eclipse/ecf/provider/remoteservice/generic/RegistrySharedObject.java
index c8cfeddba..425d48ef5 100644
--- a/providers/bundles/org.eclipse.ecf.provider.remoteservice/src/org/eclipse/ecf/provider/remoteservice/generic/RegistrySharedObject.java
+++ b/providers/bundles/org.eclipse.ecf.provider.remoteservice/src/org/eclipse/ecf/provider/remoteservice/generic/RegistrySharedObject.java
@@ -175,24 +175,14 @@ public class RegistrySharedObject extends AbstractSharedObject {
*/
}
- protected Event handleSharedObjectMsgEvent(ISharedObjectMessageEvent event) {
- Object data = null;
- if (event instanceof RemoteSharedObjectEvent) {
- RemoteSharedObjectEvent rsoe = (RemoteSharedObjectEvent) event;
- data = rsoe.getData();
- if (data instanceof SharedObjectMsgEvent) {
- SharedObjectMsgEvent some = (SharedObjectMsgEvent) data;
- try {
- some.getSharedObjectMsg().invoke(this);
- } catch (Exception e) {
- messageError(MSG_INVOKE_ERROR_CODE,
- MSG_INVOKE_ERROR_MESSAGE, e);
- }
-
- }
+ protected boolean handleSharedObjectMsg(SharedObjectMsg msg) {
+ try {
+ msg.invoke(this);
+ } catch (Exception e) {
+ messageError(MSG_INVOKE_ERROR_CODE,
+ MSG_INVOKE_ERROR_MESSAGE, e);
}
-
- return event;
+ return false;
}
private void messageError(int code, String message, Throwable exception) {

Back to the top