You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@mina.apache.org by peter royal <pr...@apache.org> on 2006/03/04 21:37:17 UTC

use java 5 and retroweaver for 1.4 compatibility

since MINA is targeting high-performance systems with high levels of  
concurrency, I think it will bring the greatest value to our users to  
use the concurrency features present in Java5 (it will also help  
lower bugs relating to this, as there are higher-level objects to  
deal with locking/etc).

I propose that the RetroWeaver project <http:// 
retroweaver.sourceforge.net/> be used to provide Java 1.4  
compatibility. It will allow usage of new language features, but more  
importantly, usage of the concurrency bits with a bridge to the  
backport <http://dcl.mathcs.emory.edu/util/backport-util-concurrent/ 
index.php>

-pete

-- 
proyal@apache.org - http://fotap.org/~osi



Re: use java 5 and retroweaver for 1.4 compatibility

Posted by peter royal <pe...@pobox.com>.
On Mar 7, 2006, at 12:04 AM, Trustin Lee wrote:
> It translates byte code AFAIK.  Please take a look at this  
> description:
>
> Retrotranslator <http://sourceforge.net/projects/retrotranslator>  
> is a Java
>> bytecode transformer that translates Java classes compiled with  
>> JDK 5.0into classes that can be run on JVM
>> 1.4. It is a free, open-source tool based on the ASM bytecode  
>> manipulation
>> framework <http://asm.objectweb.org/> and concurrency utilities  
>> backported
>> to Java 1.4<http://dcl.mathcs.emory.edu/util/backport-util- 
>> concurrent/index.php>
>> .

right :)

what i meant was, it should be able to generate a 1.4-compatible jar  
as part of the build, so it would create the 1.5-compatible jar and  
the translated jar as well.
-pete

-- 
(peter.royal|osi)@pobox.com - http://fotap.org/~osi


Re: use java 5 and retroweaver for 1.4 compatibility

Posted by Trustin Lee <tr...@gmail.com>.
On 3/7/06, peter royal <pr...@apache.org> wrote:
>
> On Mar 6, 2006, at 9:21 PM, Trustin Lee wrote:
> > On 3/7/06, peter royal <pe...@pobox.com> wrote:
> >>
> >> I have no idea how to make it automatic, but if you add:
> >>
> >>         <plugin>
> >>          <groupId>org.codehaus.mojo</groupId>
> >>          <artifactId>retrotranslator-maven-plugin</artifactId>
> >>        </plugin>
> >>
> >> to the POM, and then run 'mvn retrotranslator:translate', it will
> >> translate the classes.. as for turning them into a jar and
> >> integration into the build, nfi, since maven doesn't have any
> >> documentation :)
> >
> >
> > I know the plugin, but my question is: 'Does the translated JAR
> > deployed
> > when I run mvn deploy or mvn install?'  Did you try installation or
> > deployment?  If the translated JAR is also processed, this is a
> > very good
> > news... though I guess Maven won't do this magic for us. :)  So my
> > idea is
> > to build a project type called 'retrotranslated-jar' which pulls a
> > JAR from
> > an M2 repository and retro-translate it.
>
> I think it will translate the source.. when you do what I mentioned
> before, it processes the source of the project.. so I believe that in
> principal, we should be able to generate 2 jars, the regular jar, and
> a translated one. I'll continue to track down how to make this work :)
> -pete


It translates byte code AFAIK.  Please take a look at this description:

Retrotranslator <http://sourceforge.net/projects/retrotranslator> is a Java
> bytecode transformer that translates Java classes compiled with JDK 5.0into classes that can be run on JVM
> 1.4. It is a free, open-source tool based on the ASM bytecode manipulation
> framework <http://asm.objectweb.org/> and concurrency utilities backported
> to Java 1.4<http://dcl.mathcs.emory.edu/util/backport-util-concurrent/index.php>
> .


HTH,
Trustin
--
what we call human nature is actually human habit
--
http://gleamynode.net/
--
PGP key fingerprints:
* E167 E6AF E73A CBCE EE41  4A29 544D DE48 FE95 4E7E
* B693 628E 6047 4F8F CFA4  455E 1C62 A7DC 0255 ECA6

Re: use java 5 and retroweaver for 1.4 compatibility

Posted by peter royal <pr...@apache.org>.
On Mar 6, 2006, at 9:21 PM, Trustin Lee wrote:
> On 3/7/06, peter royal <pe...@pobox.com> wrote:
>>
>> I have no idea how to make it automatic, but if you add:
>>
>>         <plugin>
>>          <groupId>org.codehaus.mojo</groupId>
>>          <artifactId>retrotranslator-maven-plugin</artifactId>
>>        </plugin>
>>
>> to the POM, and then run 'mvn retrotranslator:translate', it will
>> translate the classes.. as for turning them into a jar and
>> integration into the build, nfi, since maven doesn't have any
>> documentation :)
>
>
> I know the plugin, but my question is: 'Does the translated JAR  
> deployed
> when I run mvn deploy or mvn install?'  Did you try installation or
> deployment?  If the translated JAR is also processed, this is a  
> very good
> news... though I guess Maven won't do this magic for us. :)  So my  
> idea is
> to build a project type called 'retrotranslated-jar' which pulls a  
> JAR from
> an M2 repository and retro-translate it.

I think it will translate the source.. when you do what I mentioned  
before, it processes the source of the project.. so I believe that in  
principal, we should be able to generate 2 jars, the regular jar, and  
a translated one. I'll continue to track down how to make this work :)
-pete

-- 
(peter.royal|osi)@pobox.com - http://fotap.org/~osi


Re: use java 5 and retroweaver for 1.4 compatibility

Posted by Trustin Lee <tr...@gmail.com>.
Hi Peter,

On 3/7/06, peter royal <pe...@pobox.com> wrote:
>
> I have no idea how to make it automatic, but if you add:
>
>         <plugin>
>          <groupId>org.codehaus.mojo</groupId>
>          <artifactId>retrotranslator-maven-plugin</artifactId>
>        </plugin>
>
> to the POM, and then run 'mvn retrotranslator:translate', it will
> translate the classes.. as for turning them into a jar and
> integration into the build, nfi, since maven doesn't have any
> documentation :)


I know the plugin, but my question is: 'Does the translated JAR deployed
when I run mvn deploy or mvn install?'  Did you try installation or
deployment?  If the translated JAR is also processed, this is a very good
news... though I guess Maven won't do this magic for us. :)  So my idea is
to build a project type called 'retrotranslated-jar' which pulls a JAR from
an M2 repository and retro-translate it.

Trustin
--
what we call human nature is actually human habit
--
http://gleamynode.net/
--
PGP key fingerprints:
* E167 E6AF E73A CBCE EE41  4A29 544D DE48 FE95 4E7E
* B693 628E 6047 4F8F CFA4  455E 1C62 A7DC 0255 ECA6

Re: use java 5 and retroweaver for 1.4 compatibility

Posted by peter royal <pe...@pobox.com>.
On Mar 5, 2006, at 9:46 PM, Trustin Lee wrote:
> I agree with you.  Actually, I was considering providing both  
> versions.  The
> problem now is how to make this work with Maven 2 so users who  
> still uses
> JDK 1.4 keep using MINA without a problem.  :)

I have no idea how to make it automatic, but if you add:

        <plugin>
         <groupId>org.codehaus.mojo</groupId>
         <artifactId>retrotranslator-maven-plugin</artifactId>
       </plugin>

to the POM, and then run 'mvn retrotranslator:translate', it will  
translate the classes.. as for turning them into a jar and  
integration into the build, nfi, since maven doesn't have any  
documentation :)
-pete

-- 
(peter.royal|osi)@pobox.com - http://fotap.org/~osi


Re: use java 5 and retroweaver for 1.4 compatibility

Posted by Trustin Lee <tr...@gmail.com>.
On 3/5/06, peter royal <pr...@apache.org> wrote:
>
> On Mar 4, 2006, at 3:37 PM, peter royal wrote:
> > since MINA is targeting high-performance systems with high levels
> > of concurrency, I think it will bring the greatest value to our
> > users to use the concurrency features present in Java5 (it will
> > also help lower bugs relating to this, as there are higher-level
> > objects to deal with locking/etc).
> >
> > I propose that the RetroWeaver project <http://
> > retroweaver.sourceforge.net/> be used to provide Java 1.4
> > compatibility. It will allow usage of new language features, but
> > more importantly, usage of the concurrency bits with a bridge to
> > the backport <http://dcl.mathcs.emory.edu/util/backport-util-
> > concurrent/index.php>
>
> Retrotranslator <http://retrotranslator.sourceforge.net/> is another
> project that would help accomplish this goal as well.


I agree with you.  Actually, I was considering providing both versions.  The
problem now is how to make this work with Maven 2 so users who still uses
JDK 1.4 keep using MINA without a problem.  :)

Trustin
--
what we call human nature is actually human habit
--
http://gleamynode.net/
--
PGP key fingerprints:
* E167 E6AF E73A CBCE EE41  4A29 544D DE48 FE95 4E7E
* B693 628E 6047 4F8F CFA4  455E 1C62 A7DC 0255 ECA6

Re: use java 5 and retroweaver for 1.4 compatibility

Posted by peter royal <pr...@apache.org>.
On Mar 4, 2006, at 3:37 PM, peter royal wrote:
> since MINA is targeting high-performance systems with high levels  
> of concurrency, I think it will bring the greatest value to our  
> users to use the concurrency features present in Java5 (it will  
> also help lower bugs relating to this, as there are higher-level  
> objects to deal with locking/etc).
>
> I propose that the RetroWeaver project <http:// 
> retroweaver.sourceforge.net/> be used to provide Java 1.4  
> compatibility. It will allow usage of new language features, but  
> more importantly, usage of the concurrency bits with a bridge to  
> the backport <http://dcl.mathcs.emory.edu/util/backport-util- 
> concurrent/index.php>

Retrotranslator <http://retrotranslator.sourceforge.net/> is another  
project that would help accomplish this goal as well.
-pete

-- 
proyal@apache.org - http://fotap.org/~osi