Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[ajdt-dev] annotating shadow methods

Hello everyone,

I'm trying to use a new continuation library (Kilim) in combination with aspects. In order to support continuations (to create light-weight threads) in Java, this library has its own weaver which I run after aspect weaving (this order cannot be changed). A requirement of this library is that all methods in a call stack that calls a method that can suspend are tagged. All these tagged methods are then instrumented by the Kilim weaver to be able to store (the state of) the stack on suspend and restart from that point on resume.

Originally tagging was done with an annotation (@pausable), but the usage of around advice breaks this paradigm as it is not possible to annotate the generated <*private static final synthetic void someMethod_aroundBody0(..)*>* *and <*private static final synthetic void **someMethod**_aroundBody1$advice(..)*> shadow methods. Since AspectJ also doesn't consider this to be join points, the annotations cannot be woven in afterwards as well.

A possible solution to the problem was to tag methods with a checked exception (throws Pausable) instead of an annotation, but while around advice allows this, the generated shadow methods do not throw Pausable themselves, invalidating this approach as well.

At the moment it seems to me that the only thing about the signature of the generated shadow methods that can be controlled is the name, but it is quite unrealistic to require a special naming convention for such methods when there is such a nice system as annotations... Is there a way to declare annotations on the generated shadow methods through AspectJ? Is there another way around this problem (without diving into asm myself)? Or is my best option at this point to start studying asm?

thanks,

Wim Depoorter
begin:vcard
fn:Wim Depoorter
n:Depoorter;Wim
org:CoMP Research Group, University of Antwerp;Department of Mathematics and Computer Science
adr:Office G2.07;;Middelheimlaan 1;Antwerp;Antwerp;B-2020;Belgium
email;internet:wim.depoorter@xxxxxxxx
title:PhD Student
tel;work:+32 3 265 32 80
tel;fax:+32 3 265 37 77
url:http://www.comp.ua.ac.be/
version:2.1
end:vcard


Back to the top