Community
Participate
Working Groups
Currently, classes derived from EventManager in org.eclipse.core.commands.common cannot be fully serialized because the EventManagers listenerList field is marked as transient. The RAP project maintains a 'fork' of JFace with with changes to make JFace run in a multi-user web environment. We are in the process of enabling transparent session-failover in RAP. To achieve this, all objects that 'live' in a session must be serializable so that a servlet container can persist the current state of a session. This applies to most classes from JFace, where in turn many of them inherit from EventManager, e.g. BaseLabelProvider. Therefore I suggest to make the private listenerList field of EventManager non-transient and change the ListenerList from org.eclipse.core.runtime to implement Serializable. With these changes, the BaseLabelProvider from the JFace/RAP bundle could be changed to implement Serializable and then be used in environments that require session-failover. I will provide a patch with the necessary changes and tests if it is agreed on that the proposed changes should be made.
org.eclipse.core.commands is in the Platform->UI git repo.
It would start with ListenerList (core.runtime) being serializable ... but the events that this class stores aren't guaranteed to be seralizable, they're just any old Object, no? PW
(In reply to comment #2) > It would start with ListenerList (core.runtime) being serializable ... but the > events that this class stores aren't guaranteed to be seralizable, they're just > any old Object, no? Right, the objects that this class stores aren't necessarily serializable. But as ListenerList is mainly used as a utility class instead of directly being exposed, the calling code can ensure that only serializable objects are stored. Like Viewer.addSelectionChangedListener() makes sure that only ISelectionChangedListeners are stored.
Created attachment 203597 [details] Patch to make ListenerList serializable This change makes org.eclipse.core.runtime.ListenerList in bundle org.eclipse.equinox.common serializable
Created attachment 203601 [details] Patch to make EventManager serializable The EventManager was made serializable. The current compiler setting is to handle serializable classes without a serialVersionUID as an error. To avoid touching all classes that inherit from EventManager, I changed the problem severity to 'ignore' for now. How would you like this case to be handled? Should I declare serialVersionUID for all affected classes?