cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Java extension SDK serialization

Highlighted
Newbie

Java extension SDK serialization

Hello,

I was working on a cache system for Thingworx, done directly from the java SDK. The matter is that no Thingworx class is Serializable !

Not all classes should be, of course, but all the "result" classes as Infotable (and all needed subclasses) should be.

The other problem is that these classes or the classes they use are often final.

This means that if you want to serialize an Infotable, you have to create an entire set of objects that would be the serializable counterparts of the non serializable Thingworx objects. And that represents a lot of classes !

My question is : Will you make these classes serializable so that we can do stuffs like a cache system without re-coding the entire Thingworx API ??

Thanks a lot !

Tags (1)
6 REPLIES 6
Highlighted

Re: Java extension SDK serialization

Just out of interest, what are you trying to cache and why...?

Highlighted

Re: Java extension SDK serialization

For instance, a result from a big query in a database.

Highlighted

Re: Java extension SDK serialization

Just another note to this : The toJSON() and fromJSON functions are not working and we cannot even use them for an infotable...

Highlighted

Re: Java extension SDK serialization

JeanBriac,

Are you trying to use the Java SDK or create a Java Extension? What version of either of these are you using?

Regards,

Meghan

Highlighted

Re: Java extension SDK serialization

Hello Meghan,

To be sure to talk about the same thing as you :

I was not doing this with the Thingworx java sdk comming from the market.

I was attempting to do it with a Thingworx java extension using the thingorx java api (downloadable from the support) and an external caching library.

When you look at the api, none of the objects are serializable.

And when you try to use the JSON methods that could have been used, these classes return null...

Highlighted

Re: Java extension SDK serialization

Hello JeanBriac,

Even if this doesn't answer your question, I tried using Infotable.ToJSON(); in 6.6.2 and it works OK, returning a nice JSON.

Beware that there are 2 snippets: One is a resource (didn't use it) and one is an Infotable method (this is the one I used.)

BR,

Vladi

Announcements

Thingworx Navigate content has a new home! Click here to access the new Thingworx Navigate forum!