You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@thrift.apache.org by Ralf Kluthe <rk...@discvision.com> on 2010/08/10 11:29:32 UTC
Thrift and java 1.4
Hello.
We want to use thrift on an embedded device for communication
between C++ and java processes. But on the embedded device
only a java VM version 1.4 is available. In this version java generics
are not supported.
Is there any possibility to use Thrift with java 1.4?
Thanks,
Ralf
Re: Thrift and java 1.4
Posted by Fred Potter <fp...@gmail.com>.
Sure, here it is.
Patch:
http://fpotter_public.s3.amazonaws.com/thrift_j2me.patch
Modified Java Runtime:
http://fpotter_public.s3.amazonaws.com/thrift_j2me_runtime.tar
To get the version of Thrift I was using:
svn co -r 684377 http://svn.apache.org/repos/asf/incubator/thrift/trunk thrift
To apply the patch:
cd thrift
patch -p0 -i /path/to/thrift_j2me.patch
To generate:
thrift -gen java:j2me yourfile
You'll probably want to throw out the TSocket in my modified runtime
and just grab the original TSocket or THttpClient from under
lib/java/src/com/facebook/thrift/transport
Fred
On Wed, Aug 11, 2010 at 6:32 AM, Ralf Kluthe <rk...@discvision.com> wrote:
> Hello Fred.
>
>
>
> Thank you for the information.
>
> I'm interested in the patch.
>
>
>
> For my understanding
>
> The patch only works with the old thrift version
>
> of 2008. Is this right?
>
> Alternatively, I have the idea to map the C++ interface
> of a thrift server/client to Java version 1.4 by using the
>
> JNI.
>
>
>
>
>
> Ralf
>
> -----Ursprüngliche Nachricht-----
> Von: Fred Potter [mailto:fpotter@gmail.com]
> Gesendet: Dienstag, 10. August 2010 20:06
> An: thrift-dev@incubator.apache.org
> Betreff: Re: Thrift and java 1.4
>
>
>
> I have a patch against a very old version of Thrift (summer 2008, I
>
> think) that makes the generator output Java 1.0 compatible code (I
>
> needed to run on J2ME devices at the time). There's also a slightly
>
> modified runtime. The binary protocol then is the same as it is now,
>
> so it should run against current Thrift servers.
>
>
>
> I'm happy to send it to you if you like. You'll have to fiddle with
>
> the Transport part as what I was doing for J2ME probably won't work
>
> for you. Also, I never got around to supporting "set" types.
>
>
>
> Fred
>
>
>
> On Tue, Aug 10, 2010 at 2:29 AM, Ralf Kluthe <rk...@discvision.com> wrote:
>
>> Hello.
>
>>
>
>> We want to use thrift on an embedded device for communication
>
>> between C++ and java processes. But on the embedded device
>
>> only a java VM version 1.4 is available. In this version java generics
>
>> are not supported.
>
>> Is there any possibility to use Thrift with java 1.4?
>
>>
>
>>
>
>>
>
>> Thanks,
>
>>
>
>> Ralf
>
>>
>
>>
>
>
AW: Thrift and java 1.4
Posted by Ralf Kluthe <rk...@discvision.com>.
Hello Fred.
Thank you for the information.
I'm interested in the patch.
For my understanding
The patch only works with the old thrift version
of 2008. Is this right?
Alternatively, I have the idea to map the C++ interface
of a thrift server/client to Java version 1.4 by using the
JNI.
Ralf
-----Ursprüngliche Nachricht-----
Von: Fred Potter [mailto:fpotter@gmail.com]
Gesendet: Dienstag, 10. August 2010 20:06
An: thrift-dev@incubator.apache.org
Betreff: Re: Thrift and java 1.4
I have a patch against a very old version of Thrift (summer 2008, I
think) that makes the generator output Java 1.0 compatible code (I
needed to run on J2ME devices at the time). There's also a slightly
modified runtime. The binary protocol then is the same as it is now,
so it should run against current Thrift servers.
I'm happy to send it to you if you like. You'll have to fiddle with
the Transport part as what I was doing for J2ME probably won't work
for you. Also, I never got around to supporting "set" types.
Fred
On Tue, Aug 10, 2010 at 2:29 AM, Ralf Kluthe <rk...@discvision.com> wrote:
> Hello.
>
> We want to use thrift on an embedded device for communication
> between C++ and java processes. But on the embedded device
> only a java VM version 1.4 is available. In this version java generics
> are not supported.
> Is there any possibility to use Thrift with java 1.4?
>
>
>
> Thanks,
>
> Ralf
>
>
Re: Thrift and java 1.4
Posted by Fred Potter <fp...@gmail.com>.
I have a patch against a very old version of Thrift (summer 2008, I
think) that makes the generator output Java 1.0 compatible code (I
needed to run on J2ME devices at the time). There's also a slightly
modified runtime. The binary protocol then is the same as it is now,
so it should run against current Thrift servers.
I'm happy to send it to you if you like. You'll have to fiddle with
the Transport part as what I was doing for J2ME probably won't work
for you. Also, I never got around to supporting "set" types.
Fred
On Tue, Aug 10, 2010 at 2:29 AM, Ralf Kluthe <rk...@discvision.com> wrote:
> Hello.
>
> We want to use thrift on an embedded device for communication
> between C++ and java processes. But on the embedded device
> only a java VM version 1.4 is available. In this version java generics
> are not supported.
> Is there any possibility to use Thrift with java 1.4?
>
>
>
> Thanks,
>
> Ralf
>
>
Re: Thrift and java 1.4
Posted by Bryan Duxbury <br...@rapleaf.com>.
No. The code generator and library are very much built around generics. I'm
sure that you *could* hack that stuff out, but I don't think it would be
trivial.
On Tue, Aug 10, 2010 at 2:29 AM, Ralf Kluthe <rk...@discvision.com> wrote:
> Hello.
>
> We want to use thrift on an embedded device for communication
> between C++ and java processes. But on the embedded device
> only a java VM version 1.4 is available. In this version java generics
> are not supported.
> Is there any possibility to use Thrift with java 1.4?
>
>
>
> Thanks,
>
> Ralf
>
>