Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

XMLDecoder -> how to update the properties previously deserialized javabeans [newbie]  RSS feed

Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
As this post is mostly about javabeans deserialization, I hope it won't be too much off-topic. I apologize if this is the case but I couldn't find a better place for that post in Javaranch.
We're developping the client part of a 3 tier application. The main principle is the following:
The application server delivers XML JInternalFrame descriptions to the client.
The client then deserializes them (and all their contained components) using an XMLDecoder and adds it to a JDesktopPane
Now let's say that the displayed data have been changed server side (let's say by another user).
As the client data must always be "in sync" with the serverside db, the server must send another XML document to the client describing the properties changes for it to update the frame components (tables or textfields let's say).
It seems that I can't use the XMLDecoder to achieve this : once the beans deserialized, it seems to lose all the references to them. We can only use the XMLDecoder "idref mechanism" with beans described in the current XML document.
What would be a good way to handle this?
Subclassing the XMLDecoder to make it keep the references to beans as long as the frames they're contained in aren't closed could be a solution but probably not a good one.
Anyone there would have an idea?
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!