Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [aspectj-users] ITD based on annotations

> And I was just wondering if there is any particular reason for it. 

Inter-type declarations require a specific concrete type in order to 
compile the ITD on its own (and check the member against the target type).
Note this means that "this" in the body of an inter-type method declaration
will refer to the type declared-on (e.g., IMyInterface), and not the
actual class where the method is added (e.g., MyInterfaceImplementation)
(unless they are the same - "public int MyClass.f;"). 

> garbage collection for Aspects, when using the pertypewithin 

The aspect can be garbage-collected when the corresponding Class can be,
regardless of the number of instances of that class.

hth - Wes


> ------------Original Message------------
> From: Paulo Alexandre Corigo Zenida <paulo.zenida@xxxxxxxx>
> To: "AspectJ Mailling List" <aspectj-users@xxxxxxxxxxx>
> Date: Wed, Mar-22-2006 1:17 PM
> Subject: [aspectj-users] ITD based on annotations
>
> Hello,
> 
> Currently, in order to do ITD based on annotations, we have to use 
> interfaces, injecting code in the interface and not in the class 
> itself, directly, like this:
> 
> declare parents : (@MyAnnotation *) implements MyInterface;
> 
> public void MyInterface.foo() { ... }
> 
> So, it's not possible to do ITD based on an annotation type, in the 
> class itself... Something like this:
> 
> public void (@MyAnnotation *).foo() { ... }
> 
> And I was just wondering if there is any particular reason for it. Can 
> you help me, please? :)
> 
> By the way, another issue, which is just a curiousity, is related to 
> garbage collection for Aspects, when using the pertypewithin 
> instantiation mechanism. So, with that kind of instantiation, we get a 
> new instance of an aspect for each type, right? So, let us suppose we 
> have an aspect that matches for a class called A and we create three 
> instances of that class (creating only one instance of the aspect); and 
> 
> after a while, all those instances are garbage collected; what happens 
> to the Aspect? Is it garbage collected too?
> 
> Thanks for your interest.
> 
> Cheers,
> 
> Paulo Zenida
> 
> ----------------------------------------------------------------
> Mensagem enviada usando o IMP (Internet Messaging Program).
> 
> 
> _______________________________________________
> aspectj-users mailing list
> aspectj-users@xxxxxxxxxxx
> https://dev.eclipse.org/mailman/listinfo/aspectj-users
> 



Back to the top