you can use this () pointcut:
pointcut services(Server s, Object o) : target(s) && this(o) && call....
Obviously, you can use a specific type instead of Object if you need to span it.
EDIT
You can also use the thisJoinPoint variable:
Object o = thisJoinPoint.getThis();
Using this JoinPoint method often results in small performance penalties compared to using certain pointcuts; it can be used if the calling object is a static class.
In this case, there is no "this", so this (o) may not match, and thisJoinPoint.getThis () returns null.
However, using:
Class c = thisEnclosingJoinPointStaticPart.getSignature().getDeclaringType();
Will tell you a class containing a static method. Examining more signature fields may also give you a method name, etc.
source share