Let's imagine the following aspect:
aspect FaultHandler {
pointcut services(Server s): target(s) && call(public * *(..));
before(Server s): services(s) {
// How to retrieve the calling object instance?
if (s.disabled) ...;
}
}
The pointcut captures all calls to public methods of Server
and runs the before
advice just before any of these are called.
Is it possible to retrieve the object instance performing the call to the public Server
method in the before
advice? If yes, how?