If you add "JoinPoint joinPoint" you can get that information:
public void beforeAnyPublicMethod(JoinPoint joinPoint)
{
this.logBefore(joinPoint.getTarget().getClass(),
joinPoint.getSignature().getName(), joinPoint.getArgs());
}
Ron DiFrango
Director / Architect | CapTech
(804) 855-9196 |
[email protected]<https://email4.captechventures.com/owa/UrlBlockedError.aspx>
________________________________
From: [email protected] [[email protected]] on
behalf of Evermind [[email protected]]
Sent: Thursday, January 23, 2014 7:42 AM
To: aspectj-users
Subject: [aspectj-users] [Feature Request] being able to capture package, class
or method name on pointcut
Hi,
I was writing an aspect that intercepts apache commons log calls and call
corresponding method of my own logger instead. To achieve this, I found it
inconvenient to pointcut call of methods with same parameter but different
name. Shown as below:
pointcut logging_info(Object message):
call(void org.apache.commons.logging.Log.info(Object)) && args(message);
pointcut logging_warn(Object message):
call(void org.apache.commons.logging.Log.warn(Object)) && args(message);
void around(Object message) : logging_info(message) {
mylog.log("info", message);
}
void around(Object message) : logging_warn(message) {
mylog.log("warn", message);
}
As you can see, mylog can use method name of the one intercepted by
pointcut as its argument and do right things. However AFAIK currently pointcut
cannot bind method name to variables. So i think if we can achieve
this(including package/class/method name pattern), our capabilities will be
expanded.
PS: sorry for the incomplete mail a while ago, it's a fat-finger mistake.
2014-01-23
________________________________
Evermind
_______________________________________________
aspectj-users mailing list
[email protected]
https://dev.eclipse.org/mailman/listinfo/aspectj-users