I do mean BundleEvent and as you were saying it extends EventObject and thus implements Serializable. Therefore, I was expecting it to be serializable. However, I know for Felix it is implemented with a BundleImpl member that is not serializable so you get a NotSerializableException when trying to serialize the object.
I create FELIX-3064 (https://issues.apache.org/jira/browse/FELIX-3064) because it was not implemented as serializable. According to Richard S. Hall: "Perhaps I spoke too soon. I guess I wasn't thinking, because BundeEvent is a concrete type that comes from the OSGi Alliance companion code. So, technically, I could modify the standard code and mark it as transient (in R4.3 there are actually two bundle objects referenced by the event now), but I'm not sure I want to do this. Talking it over with BJ Hargrave (OSGi CTO), he says that BundleEvent is not intended to be serializable and neither are any of the other events. Which means that you likely just have to live with it. Even if I decided to modify the standard BundleEvent class, other frameworks don't, so you'd end up being tied to the Felix framework implementation. In the end, it's probably better for you to deal with reality in this case, rather than try to avoid it. Given that, i'd be inclined to close this issue as "WON'T FIX". Apparently it is a historical mistake, it shouldn't have inherited from EventObject. If you really want to complain about it, I'd suggest you do so on the osgi-dev mailing list, since that is where people are supposed to raise spec issues." So this is why I posted something here. David Humeniuk From: Martin Petzold [mailto:[email protected]] Sent: Thursday, August 04, 2011 11:17 AM To: OSGi Developer Mail List Subject: Re: [osgi-dev] BundleEvent and others extend EventObject even thoughthey aren't serializable BundleEvent extends EventObject and thus implements Serializable [1], did you perhaps mean org.osgi.service.event.Event. Would be great to have org.osgi.service.event.Event serializable. I had some problems about this while implementing a remote event admin some time ago. [1] http://www.osgi.org/javadoc/r4v43/org/osgi/framework/BundleEvent.html Thanks, Martin Am 04.08.2011 17:08, schrieb [email protected]: EventObject implements Serializable so any class extending it should be serializable as well. However, BundleEvent and others are not serialiable and as I understand are not intended to be. Any chance the base class will change or am I stuck with this? I would rather not have special logic which ignore these types of object when sending them through RMI (or other times serializing is involved). Thanks, David Humeniuk _______________________________________________ OSGi Developer Mail List [email protected] https://mail.osgi.org/mailman/listinfo/osgi-dev
_______________________________________________ OSGi Developer Mail List [email protected] https://mail.osgi.org/mailman/listinfo/osgi-dev
