[jboss-user] [JBoss AOP] - Re: How to annotate in opposite way
do-not-reply at jboss.com
Tue Oct 28 10:01:33 EDT 2008
You can use the negation operator !.
First, take a look at the expression bellow:
call(* com.a..->*(..)) AND within(com.b..)
It will match every call to a method of a class in package com.a made by a class at package com.b
If you use this in a declare error tag, it will forbid any calls from classes of com.b to methods of classes of package com.a.
But this is not what you want. You have exceptions to this rule. There are 10 methods you want to allow being called by classes at com.b. In this case, you can use AND ! (and not):
call(* com.a..->*(..)) AND within (com.b..) AND !(call(<method_1>) OR call(<method_2>) OR ... OR call(<method_10>))
Whereas <method_i> stands for the expression matching the ith method you want to be allowed to be called, like:
So, the expression above will forbid any calls from classes at package com.b made to methods of classes belonging to package com.a, except if those methods are one of the methods that match one of the expressions method_i.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4185103#4185103
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4185103
More information about the jboss-user