Serialize ThingType [message #1793040] |
Sun, 29 July 2018 08:56  |
Eclipse User |
|
|
|
I have a custom ThingTypeProvider that I use to dynamically create ThingTypes. However, dynamically creating the ThingType is a fairly heavy process (involving network connections) and instead of recreating the ThingTypes on restarts (or activations) - I'd like to serialize the previously created ThingType(s), store them in a file and then deserialize it on activation to avoid the heavy process.
Question:
1. Is this the right approach or is there a better approach that I'm unaware of?
2. If it is the right approach - is there an 'official' way to serialize/deserialize a ThingType?
I've looked at the Xml thing type provider - but that deserializes from the thing-types.xml and doesn't seem to provide serialization. I have tried a simple GSON (json) approach - serialization seems to work but deserialization fails with some error about UID constructor (haven't looked into it in detail because I'm not sure if that's a good approach either).
Thanks,
Tim
|
|
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.03139 seconds