Your automated testing regime will have to catch any violations before deploying to production ;) I don't know of a robust way to accomplish the same thing with a "declare error" statement, but that would be ideal.
It's really useful to think through what a "critical section" means in terms of AspectJ's join point model. In this example, I'm specifically saying I don't want any advice executed while inside @Critical methods. Note that this wouldn't prevent before or after advise for calls to @Critical methods. I'm assuming that's okay. For example, it might be fine to have advice that logs that the program is about to enter a @Critical method and log after it returns.
You don't have to use a method (or class) annotation of course, but doing so keeps this aspect generic and robust as the underlying code gets refactored.
dean
On Feb 23, 2008, at 8:43 AM, Kunal Pathak wrote:
Hello All,
I am just curious to know that is there any way (may be specifying some kind of annotation) to protect the joinpoint from being woven? The reason behind my question is “security”.
Thanks,
Kunal.
_______________________________________________
aspectj-users mailing list
aspectj-users@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/aspectj-users