Skip to main content

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

Perhaps declare annotation will suit your needs:

http://www.eclipse.org/aspectj/doc/released/adk15notebook/annotations-declare.html

On Wed, Aug 6, 2008 at 2:46 AM, Wim Depoorter <wim.depoorter@xxxxxxxx> wrote:
> 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
>
> _______________________________________________
> ajdt-dev mailing list
> ajdt-dev@xxxxxxxxxxx
> https://dev.eclipse.org/mailman/listinfo/ajdt-dev
>
>


Back to the top