around advice question [message #591962] |
Tue, 24 January 2006 16:40 |
Asaf Messages: 36 Registered: July 2009 |
Member |
|
|
Hi,
I'm testing the usage of Aspectj and encountered a problem.
I wrote the following code:
public aspect myAspect{
pointcut publicMethods() : execution(public * myMain.func(..));
pointcut logObjectCalls() : execution(* Logger.*(..));
pointcut loggableCalls() : publicMethods(); //l&& ! logObjectCalls();
before() : loggableCalls(){
Logger.entry(thisJoinPoint.getSignature().toString());
}
after() : loggableCalls(){
Logger.exit(thisJoinPoint.getSignature().toString());
}
void around(): call(public void myMain.func(String)){
if(Math.random() > .5){
System.out.println("> 0.5");
proceed(); //go ahead with the method call
}
else{
System.out.println("< 0.5");
}
}
}
The function FUNC of MYMAIN class has only one argument which is of String
type.
What I would like to achieve is that I will be able to check the input
parameters in the AROUND advice.
Thanks in advance,
Asaf Lahav
|
|
|
Powered by
FUDForum. Page generated in 0.03268 seconds