[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[aspectj-users] Instanciate an aspect for each object with specific annotation

Hi all,

I want to instanciate an aspect instance with each instance of an object with specific annotation.

Exemple : 

	public class O { ... }

	public class Main {

		public static void main(String[] args) {
			new O();	=> New aspect instance
			new O();	=> New aspect instance

To express this, I write

	public aspect A perthis(within(@MyAnnotation *)) { ... }

This expression works but I wonder if this one is always the best with the addition of @this, @annotation , ...

What do you think about it ?


Mickaël Rifflard
(Atos Origin)