Reputation: 306
In AspectJ:
@Before("execution(method_a)")
public void method_b() {
}
@Before("execution(method_a)")
public void method_c() {
}
Thanks alot
Upvotes: 0
Views: 1286
Reputation: 67417
Disclaimer: I am really talking about AspectJ here because you asked that way, not about Spring AOP.
The answer is: AspectJ instruments Java byte code, but does not run in its own thread. Both advice method_b
and method_c
will run in the same thread as method_a
(awful choice of names, BTW) unless you start your own threads from within advice.
As for the order in which the two advice pointing to the same joinpoint are executed, you can select it if both advice are in different aspects via @DeclarePrecedence
. If they are within the same aspect, the order is as described here.
Upvotes: 3