Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarkus Alexander Kuppe2013-07-04 14:52:21 +0000
committerMarkus Alexander Kuppe2013-07-04 14:52:21 +0000
commit4c3a5815546f83591c294943a8a199815164e6a4 (patch)
tree2bd34c95c01c50a6eecd7a844b5a202287c8c5a4 /server-side/bundles/org.eclipse.ecf.remoteservice.eventadmin
parent610a2412e9e31426f32cc2da16a9117f1670584f (diff)
downloadorg.eclipse.ecf-4c3a5815546f83591c294943a8a199815164e6a4.tar.gz
org.eclipse.ecf-4c3a5815546f83591c294943a8a199815164e6a4.tar.xz
org.eclipse.ecf-4c3a5815546f83591c294943a8a199815164e6a4.zip
NEW - bug 412261: [Distributed EventAdmin] Allow to only log
serialization failures https://bugs.eclipse.org/bugs/show_bug.cgi?id=412261 - Part #2: Allows to register an EventTopicFilter service that gets looked up by DistributedEventAdmin. On a filter hit, the event will only be send out locally
Diffstat (limited to 'server-side/bundles/org.eclipse.ecf.remoteservice.eventadmin')
-rw-r--r--server-side/bundles/org.eclipse.ecf.remoteservice.eventadmin/src/org/eclipse/ecf/remoteservice/eventadmin/EventMessage.java24
1 files changed, 21 insertions, 3 deletions
diff --git a/server-side/bundles/org.eclipse.ecf.remoteservice.eventadmin/src/org/eclipse/ecf/remoteservice/eventadmin/EventMessage.java b/server-side/bundles/org.eclipse.ecf.remoteservice.eventadmin/src/org/eclipse/ecf/remoteservice/eventadmin/EventMessage.java
index 21fb3a63d..f89d2ab0a 100644
--- a/server-side/bundles/org.eclipse.ecf.remoteservice.eventadmin/src/org/eclipse/ecf/remoteservice/eventadmin/EventMessage.java
+++ b/server-side/bundles/org.eclipse.ecf.remoteservice.eventadmin/src/org/eclipse/ecf/remoteservice/eventadmin/EventMessage.java
@@ -16,6 +16,8 @@ import java.io.Serializable;
import java.util.Hashtable;
import java.util.Map;
+import org.eclipse.ecf.internal.remoteservice.eventadmin.NoSerializationHandler;
+import org.eclipse.ecf.remoteservice.eventadmin.serialization.SmartSerializationHandler;
import org.osgi.service.event.Event;
/**
@@ -24,6 +26,12 @@ import org.osgi.service.event.Event;
public class EventMessage implements Serializable {
private static final long serialVersionUID = 2743430591605178391L;
+
+ /**
+ * @since 1.2
+ */
+ public static SmartSerializationHandler serializationHandler = new NoSerializationHandler();
+
private String topic;
private Map properties;
@@ -47,8 +55,9 @@ public class EventMessage implements Serializable {
: new Hashtable(propertyNames.length);
for (int i = 0; i < propertyNames.length; i++) {
Object val = event.getProperty(propertyNames[i]);
- if (!(val instanceof Serializable || val instanceof Externalizable))
- throw new NotSerializableException("Cannot serialize property value of name="+propertyNames[i]+" and value="+val);
+ if (!(val instanceof Serializable || val instanceof Externalizable)) {
+ val = serializationHandler.serialize(val);
+ }
ht.put(propertyNames[i], val);
}
return ht;
@@ -59,7 +68,16 @@ public class EventMessage implements Serializable {
}
protected Map getProperties() {
- return properties;
+// if (useSmartSerialization) {
+// // check to see if there is a smart serialized object contained in
+// // the props
+// for (int i = 0; i < properties.size(); i++) {
+//
+// }
+// return properties;
+// } else {
+ return properties;
+// }
}
protected Event createLocalEvent() {

Back to the top