Support for distributed environments
Support for distributed environments
Is there a good reason for why the various DataSet's (and their sub components as TimeSeries e t c) doesn't implement java.io.Serializable?
Re: Support for distributed environments
The only reason is that serialisation is something I haven't looked closely at, so I don't know what issues are involved. I'll do some reading on it when I get a chance, or take advice from any experts out there...
Regards,
DG.
Regards,
DG.
Re: Support for distributed environments
Can I also add a comment.
Many Servlet 2.2 engines use serialisation to support "distributed" sessions across multiple machines, or load balancing efforts.
Therefore if you use the JFreeChart classes in a servlet and stick it in the servlet session you can get exceptions very easily.
From much of what I have seen in the JFreeChart classes, adding
implements java.io.Serializable to each class would be simple and would not require custom readObject/writeObject methods. Especially the model classes.
Many Servlet 2.2 engines use serialisation to support "distributed" sessions across multiple machines, or load balancing efforts.
Therefore if you use the JFreeChart classes in a servlet and stick it in the servlet session you can get exceptions very easily.
From much of what I have seen in the JFreeChart classes, adding
implements java.io.Serializable to each class would be simple and would not require custom readObject/writeObject methods. Especially the model classes.
Re: Support for distributed environments
Thanks for the info Brad...I still haven't had a chance to read up about Serialization, unfortunately!
Regards,
Dave Gilbert
Regards,
Dave Gilbert
Re: Support for distributed environments
I have done a prelimenary examination of adding Serilisation support to JFreeChart.
In short it is a pretty basic exercise. Most classes simply need
..... implements java.io.Serializable
add to them to work. Java Serialzation can easily read and write simple dasta types and objects with simple data types. Therefore most of the plot "models" can easily be made Seriazable.
And because it is "inherited" only the base classes need be marked.
UI based classes that have java.awt.geom classes in them need some more work. The java.awt.geom classes are not serializable.
Hence the member variables need to be marked as "transient" and "recreated" during Serialization readObject()/writeObject() methods.
In fact they might not even need this they can be created dynamically when used from other data.
For more info see:
http://java.sun.com/docs/books/tutorial ... ation.html
The reason I need such support is that my Servlet project http://echopoint.sourceforge.net has support for JFreeChart as well as providing a Servlet based component wrapper for the Meter classes.
And as I said in the previous post, the Servlet 2.2 spec says that objects in the servlet session can be "Serialised" at any time.
Therefore to save the state of my JFreeChart component, I need to be able to Serilaise it, or at least its data models and then recreate it on readObject().
Cheers
Brad
In short it is a pretty basic exercise. Most classes simply need
..... implements java.io.Serializable
add to them to work. Java Serialzation can easily read and write simple dasta types and objects with simple data types. Therefore most of the plot "models" can easily be made Seriazable.
And because it is "inherited" only the base classes need be marked.
UI based classes that have java.awt.geom classes in them need some more work. The java.awt.geom classes are not serializable.
Hence the member variables need to be marked as "transient" and "recreated" during Serialization readObject()/writeObject() methods.
In fact they might not even need this they can be created dynamically when used from other data.
For more info see:
http://java.sun.com/docs/books/tutorial ... ation.html
The reason I need such support is that my Servlet project http://echopoint.sourceforge.net has support for JFreeChart as well as providing a Servlet based component wrapper for the Meter classes.
And as I said in the previous post, the Servlet 2.2 spec says that objects in the servlet session can be "Serialised" at any time.
Therefore to save the state of my JFreeChart component, I need to be able to Serilaise it, or at least its data models and then recreate it on readObject().
Cheers
Brad