Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[aspectj-users] Re: Dynamically disable a pointcut

Ashank,

But if i disabled the boolean, still all methods got evaluated.

For ex: 

In the following code, if isTraceEnabled = false, before() and after () did
not get called, but still all methods are getting evaluated which is making
my app very slow.  If I disabled the flag, nothing should be evaluated from
aspect right?

pointcut traceMethods(): if (isTraceEnabled)                              
		 && (execution(* *.*(..)) || execution(*.new(..))) 
		 && !within(*TraceAspect)
		 && !execution(* *.*$*(..)) 
		 && !within(Pointcuts.*);                             

before() : traceMethods()
{
	Signature sig = thisJoinPointStaticPart.getSignature();
	methodName = sig.getName();
	traceEntry(sig.getDeclaringTypeName() + "." + methodName +
printParams(thisJoinPoint));
}

after() : traceMethods()
{
	traceExit(thisJoinPointStaticPart.getSignature().toShortString());
}
-- 
View this message in context: http://aspectj.2085585.n4.nabble.com/Dynamically-disable-a-pointcut-tp2272366p2272744.html
Sent from the AspectJ - users mailing list archive at Nabble.com.


Back to the top