Monday, June 28, 2010

XStream Map<String,Ojbect> is not a good idea for Multi-Models

I guessed in an earlier post that I might be able to get multi-model work with XStream using a Map<String,Ojbect>. Well, it does not work well. The ending result is something like

{"map":
[{"entry":[
{"string":"jobs","list":[""]}, {"string":"head","org.imirsel.nema.flowservice.config.SimpleMeandreServerProxyConfig": {"host":"nema.lis.uiuc.edu","port":11714,"maxConcurrentJobs":1,"username":"admin","password":"admin"}},
{"string":"workers","map":[{"entry":"org.imirsel.nema.flowservice.config.SimpleMeandreServerProxyConfig":{"host":"nema-c-1-2","port":11714,"maxConcurrentJobs":2,"username":"admin","password":"admin"},"org.imirsel.nema.flowservice.config.MeandreServerProxyStatus":{"numRunning":0,"numAborting":0}}}]}]}]}

Not nice. It is possible in javacript, but will need quite some codes to handle. Still, I would like to stick with something required minimal massaging in javascript side. Mine current solution seems better.

No comments :