Hi Daniele,
Yeah, the way we deal with nested objects like this is kind of weird. So I think there are a couple of things things going on here.
The first is that JAIInfo and CoverageAcecssInfo don’t extend from the Info interface, so modification proxy doesn’t treat them like any differently than a “regular” object ,in that they generally don’t get picked up as dirty unless they are set with a setter. So one way to fix this problem would be to have them extend from the Info interface.
WIth that I believe that modification proxy will actually treat them as “dirty” when you do something like this:
GeoServerInfo global = geoServer.getGlobal();
JAIInfo jai = global.getJAI();
jai.setSomething(…);
geoServer.save(global);
SO what you will get is a property changed event which reports that the “JAI” property has changed. The trouble is that as currently implemented the new value and the old value will be the same object. And of course it doesn’t give you any notion of what properties in the nested object has changed.
I am not so sure how to fix this. Obviously the change of hanging the interfaces extend Info is a trivial one but how to report the changes to the nested objects isn’t. One thing we could do is instead of just reporting that the “jai” object changes is use a nested notation to report what properties actually changed, and pass them into the listener method. SO instead of af an event that looks like this:
postModifed(GeoServerINfoImp@anonymised.com, [“jai”], [JAIInfoImpl@anonymised.com], [JAIInfoImpl@anonymised.com])
You would get one like:
postModifed(GeoServerINfoImp@anonymised.com, [“jai.something”], [“oldSomething”], [“newSomething”])
If that makes sense? This would require some changes to modification proxy.
An alternative would be to ensure we throw multiple events in this case. Not sure which one is better.
-Justin
On Thu, Jul 19, 2012 at 2:33 AM, Daniele Romagnoli <daniele.romagnoli@anonymised.com> wrote:
Hi all,
yesterday I was debugging geoserver to figure out why any global change is triggering a JAI initialization and a coverageAccess initialization.
Long story short the handleGlobalChange and the handlePostGlobalChange of the custom ConfigurationListenerAdapter simply invoke the initialization method without doing any check of the changed properties/values.
Beside of that, I have noticed that the propertyNames, oldValues and newValues lists are empty (even when changing some params from the JAI page or the CoverageAccess page). The only changing thing seems the “updateSequence”.
After a brief meeting with Andrea, the outcome of the discussion is that the properties changes won’t be reported to the listener in case the properties belong to an object which is nested in the main object (as CoverageAccessInfo and JAIInfo are nested into GeoServerInfo).
Having these properties changes being notified would allow to check them and potentially avoid some initializations (JAI TileCache settings, TileScheduler settings, Tile Recycling , CoverageAccess threadPoolExecutor settings) when they aren’t needed.
How can we deal with that?
Best Regards,
Daniele
Ing. Daniele Romagnoli
Senior Software Engineer
GeoSolutions S.A.S.
Via Poggio alle Viti 1187
55054 Massarosa (LU)
Italy
phone: +39 0584 962313
fax: +39 0584 962313
http://www.geo-solutions.it
http://twitter.com/geosolutions_it
Live Security Virtual Conference
Exclusive live event will cover all the ways today’s security and
threat landscape has changed and how IT managers can respond. Discussions
will include endpoint security, mobile security and the latest in malware
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
Geoserver-devel mailing list
Geoserver-devel@anonymised.comsts.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-devel
–
Justin Deoliveira
OpenGeo - http://opengeo.org
Enterprise support for open source geospatial.