[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [ecf-dev] My experience with ECF

On 11/5/2014 2:10 PM, J Langley wrote:
Hi,

One issue that we ran into was that we were using an EClass with EOperations to define the interface that we publish as an OSGi service.  Using the default parameters in the genmodel gave us methods that return an EList<EClass> instead of a normal List<Class>.  The EList caused problems during serialization, so we wound up regenerating the interface class using the "suppress EMF types" option set to true.  We only needed to use this option for the interface classes, not the data types being passed.

Much of our data types were serializable without any needed updates.  The problem popped up when we had use the EDataType to bring in other Java types that are not seriailizable.  We wound up writing a single serialization helper class that packs an EObject into a resource and then serialized the resource.  The opposite happens on the receive side.  It was a lot of work to capture all of the referenced objects as well, since they have to be packed into the resource as well (in reverse order).  This was the bane of my existence for a few weeks.  We updated the Class.javajet template to have each class implement serializable and added the writeObject and readObject to turn around and call our Serialization helper.

Much of the debugging included writing the serialization resource to a temp file on writeObject and readObject so we could get an idea of what data was being included.  Also - don't forget to find the properties that govern the timeout values and update them to give you enough time to step through code if needed.

Another note that I still do not understand - there were unit tests that ran successfully in a single process (writing to a byte stream and reading an object back from the byte stream) that failed when run cross process through a socket.  There may be some static registration of objects happening in the Resource class that allowed things to pass.  I did not have enough time to fully investigate.

I'll update this thread as I remember more issues.

Feel free to drop in more questions as well.  I plan on creating a type of "Lessons Learned" presentation on this.

Good idea.   Perhaps you could add to the ECF wiki:  http://wiki.eclipse.org/ECF and it would/could thereby be included in the ECF documentation.

Since many of these comments seem to be about about EMF and serialization...perhaps there should be a 'Using EMF in remote services' section...or something like that.

Scott