Community
Participate
Working Groups
Bug #412180 makes clear that not all consumers/users of OSGi EventAdmin follow the OSGi EventAdmin spec guideline and only send primitives as event data. Thus, for event data not implementing serializable, we should use "SmartSerialization" (see http://git.eclipse.org/c/ecf/org.eclipse.ecf.git/tree/protocols/bundles/ch.ethz.iks.r_osgi.remote/src/main/java/ch/ethz/iks/util/SmartObjectOutputStream.java). (Also see bug #385740)
(In reply to comment #0) > Bug #412180 makes clear that not all consumers/users of OSGi EventAdmin > follow the OSGi EventAdmin spec guideline and only send primitives as event > data. Thus, for event data not implementing serializable, we should use > "SmartSerialization" (see > http://git.eclipse.org/c/ecf/org.eclipse.ecf.git/tree/protocols/bundles/ch. > ethz.iks.r_osgi.remote/src/main/java/ch/ethz/iks/util/ > SmartObjectOutputStream.java). > > (Also see bug #385740) Although I don't particularly mind the idea of using the 'Smart Serialization' to enhance regular 'ol object serialization...this doesn't in general solve the problem...as even the r_osgi smart serialization can/will fail in what could be considered 'common' use cases by some. I expect that...similar to remote service params and return values...that each remote eventadmin provider will have to constrain what can/cannot be serialized.
(In reply to comment #1) > Although I don't particularly mind the idea of using the 'Smart > Serialization' to enhance regular 'ol object serialization...this doesn't in > general solve the problem...as even the r_osgi smart serialization can/will > fail in what could be considered 'common' use cases by some. > > I expect that...similar to remote service params and return values...that > each remote eventadmin provider will have to constrain what can/cannot be > serialized. I totally agree that SmartSerialization won't be a silver bullet. Besides simply failing in some use-cases, it will probably severely degrade performance in others where the application logic sends massive amounts of data via the event bus. Thus, this enhancement should allow to turn SmartSerialization completely off (via a system property).
Also see bug #412261 ([Distributed EventAdmin] Allow to only log serialization failures)
Fix with commit 5c3c256bf85388a923d3a556497f2162224ae6b2 [1] in master. [1] http://git.eclipse.org/c/ecf/org.eclipse.ecf.git/commit/?id=5c3c256bf85388a923d3a556497f2162224ae6b2
Created attachment 233123 [details] mylyn/context/zip
The fix adds an API to hook in custom serializers (see the eventadmin example). The default impl uses standard Java serialization and simply fails for non-serializable/externalizable objects (this is consistent behavior with the previous impl). A more powerful serialization can either reuse r-OSGi "SmartSerialization" or e.g. use Kryo [1]. [1] http://code.google.com/p/kryo/
(In reply to Markus Kuppe from comment #2) > I totally agree that SmartSerialization won't be a silver bullet. Besides > simply failing in some use-cases, it will probably severely degrade > performance in others where the application logic sends massive amounts of > data via the event bus. James Sutherland blogged a performance comparison that includes Kryo [1]. [1] http://java-persistence-performance.blogspot.com/2013/08/optimizing-java-serialization-java-vs.html
See bug #419327 WRT r-OSGi (slightly related)