Re: Generating Avalon meta information using apt

"Raffael Herzog" <[email protected]>
Newsgroups gmane.comp.jakarta.avalon.user
Organization Codeshack AG
Message-ID <[email protected]>
On Fri, 17 Sep 2004 23:20:46 +0800, Niclas Hedhman <[email protected]>  
wrote:

> On Friday 17 September 2004 18:48, Raffael Herzog wrote:
>> The interface (ClassFileTransformer) is rather simple:
>>
>> byte[] transform(ClassLoader loader,
>>                   String className,
>>                   Class<?> classBeingRedefined,
>>                   ProtectionDomain protectionDomain,
>>                   byte[] classfileBuffer)
>
> And how big security hole is this, I wonder??

Well, you specify the transformer on the command line using  
-javaagent:<jarpath>[=<options>]. This one's for the AOP and AppServer  
people. There's no way to install such a transformer for classes not  
specified on the command line.


> If we put the @Dependency and other annotations in the Avalon source, we  
> need
> to deal with it, since the distro has a requirement of being built with  
> the
> JDK1.3. So it IS an issue.

I perfectly understand that and that's not what I was talking about. The  
solution I have in mind is one that wouldn't affect *any* of the existing  
code.

My approach to the problem is the following:

Anyone who targets Java2 <= 1.4.x doesn't have any problems with the  
current build system.

Anyone who targets Java2v5 *will* have a problem: The plugin is simply  
unusable. But for those people, there's absolutely no problem in using  
Java2v5-only constructs in their *own* sources. So solve the problem for  
those people somehow, preferably in a way that will be supported later,  
when Avalon itself moves to Java2v5.

I've made a proof-of-concept using annotations which generates .xinfo  
files using apt (yes, I know, I shouldn't have done that ... it was a  
boring week-end ;). Contact me by PM or in #merlin (Abnaxos) if you're  
interested in it. I didn't need to touch any of the existing Avalon code.  
Using this proof-of-concept I have full syntax checking, code completion  
etc. for metadata (using IDEA) and I'm able to build again. The only  
problem now is that there's no compiler plugin for Ant yet.


> I think this whole thing need some time to 'cook'. The immediate problem  
> is to
> get the Avalon source to build using JDK1.5, without using 1.5 features.

No, the immediate problem has nothing to do with the Avalon source, it  
most probably builds flawlessly on 1.5. The immediate problem is to  
provide some way to allow those who want to use 1.5 features to be able to  
build their own sources without having to maintain .xinfo files manually.

The proper solution of course is to update the parser of QDox. However,  
competely parsing and "understanding" annotations is all but trivial, so  
this will probably take some time. The bug is open and AFAIK not assigned  
(can't check right now because codehaus.org seems to be down),  
1.6-SNAPSHOT doesn't show any traces of any support for the problematic  
constructs.

cu,
    Raffi

-- 
raffael herzog
software engineer

codeshack ag
smart software solutions

hardstrasse 219, postfach
8037 zurich - switzerland

tel: +41 43 444 65 65
fax: +41 43 444 65 66

[email protected]
www.codeshack.ch
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.