Archived
This forum has been archived. Please start a new discussion on GitHub.
Slice mapping for java.lang.Object
How can I define a slice interface method with a very generic parameter which gets translated to java.lang.Object in the generated java code?
Thanks,
Sandeep
Thanks,
Sandeep
0
Comments
-
Hi,
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,
Mark0 -
Slice mapping for java.lang.Object
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?0 -
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,
Mark0 -
Slice mapping for java.lang.Object
Hi Mark,
Got it
Thanks.
Btw, does slice support methods with var args?0