Ice can only marshal types that are defined in Slice, and there is no marshalable type in Slice that maps to java.lang.Object. The Slice keyword Object represents the base type for Ice objects and maps to Ice.Object in Java. If you are looking for a way to send arbitrary Java types, one possibility is to serialize them and send them as the Slice type sequence<byte>.
I was considering using byte[] as a last resort. I think, I will have to use
the streaming API to convert params to byte[] and back. Is this correct?
For the other option, using Ice.Object, I guess java types have
to be converted to corresponding subclasses of Ice.Object on the client
side. Can you please point me to the relevant references for implementing
this?
I was considering using byte[] as a last resort. I think, I will have to use
the streaming API to convert params to byte[] and back. Is this correct?
The Ice streaming API only supports Slice types so you cannot use it to serialize a java.lang.Object, at least not directly. It would probably be simpler to use Java's serialization mechanism instead.
For the other option, using Ice.Object, I guess java types have
to be converted to corresponding subclasses of Ice.Object on the client
side. Can you please point me to the relevant references for implementing
this?
Essentially you would need to define a Slice class that is equivalent to each Java type you wish to transmit. The Slice-to-Java mapping for classes is described here.
Comments
Ice can only marshal types that are defined in Slice, and there is no marshalable type in Slice that maps to java.lang.Object. The Slice keyword Object represents the base type for Ice objects and maps to Ice.Object in Java. If you are looking for a way to send arbitrary Java types, one possibility is to serialize them and send them as the Slice type sequence<byte>.
Hope that helps,
Mark
Hi,
I was considering using byte[] as a last resort. I think, I will have to use
the streaming API to convert params to byte[] and back. Is this correct?
For the other option, using Ice.Object, I guess java types have
to be converted to corresponding subclasses of Ice.Object on the client
side. Can you please point me to the relevant references for implementing
this?
Take care,
Mark
Hi Mark,
Got it
Thanks.
Btw, does slice support methods with var args?
Regards,
Mark