Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[ice-dev] Updates to XML Persistence.

Everyone,

I have updated the way ICE creates at JAXBContext instance for XML persistence of our data structures. The XMLPersisitenceProvider now registers and keeps track of IJAXBClassProvider realizations, through OSGi Declarative Services, and uses them to pull a list of classes that the JAXBContext needs to be aware of for marshaling/unmarshaling our data structures. There is a default realization of this class provider, ICEJAXBClassProvider that is in the data structures bundle and returns the list of Component classes the Form used to keep track of for persistence. This removes the unwanted dependency of the Form on Component realizations, and makes it easier for external devs to create Components.

So if you do add a new Component realization within ICE, make sure you append to the class list being returned in ICEJAXBClassProvider, or else your Items that contain the Component will not persist correctly. And if you add to that list, make sure you update the ICEJAXBClassProviderTester as well. Note also that when writing to XML just using the ICEJAXBHandler, you can just create a class list to give it in the following way:

classList.add(new ICEJAXBClassProvider().getClasses());
classList.add(YourComponent.class)

If you are developing a Component external to ICE, you must provide a realization of the IJAXBClassProvider that registers with the XMLPersistenceProvider through OSGi Declarative Services and returns the data structures Class types that are relevant for the JAXBContext instance.

Best,

Alex





Back to the top