Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » AJDT » around advice question
around advice question [message #591962] Tue, 24 January 2006 16:40
Asaf is currently offline 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
Previous Topic:Can ajdt works with product's export?
Next Topic:pointcut all method calls on an object that implements an interface
Goto Forum:
  


Current Time: Fri Sep 19 22:11:27 GMT 2014

Powered by FUDForum. Page generated in 0.01559 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software