For some development/debugging aspects, I want to be able to switch them
on and off and cause the weaver to ignore them.
 
I've used the following, but I'm finding that the aspects are getting
woven anyway:
 

public aspect LogPublicAction
{
        private static final boolean ENABLED = false;

        pointcut publicCalls() : execution(......);

        /**
         * Log all public calls
         */
        before() : publicCalls() && if(ENABLED)
        {
                String javaFileLocation = "(" +
thisJoinPoint.getSourceLocation() + ")"; 
                System.out.println(thisJoinPoint.toLongString() + " from
" + javaFileLocation );
        }
}

>From a weaving efficiency point of view, wouldn't it be better to detect
that if() has been passed a constant and for the pointcut "publicCalls()
&& if(ENABLED)" to apply to no joinpoints?



**********************************************************************
IMPORTANT NOTICE.
Confidentiality:  This e-mail and its attachments are intended for the above 
named only and may be confidential.  If they have come to you in error you must 
take no action based on them, nor must you copy or show them to anyone; please 
reply to this e-mail and highlight the error.
Security Warning:  Please note that this e-mail has been created in the 
knowledge that Internet e-mail is not a 100% secure communications medium.
We advise that you understand and observe this lack of security when e-mailing 
us.
Viruses:  Although we have taken steps to ensure that this e-mail and 
attachments are free from any virus, we advise that in keeping with good 
computing practice the recipient should ensure they are actually virus free.
Monitoring and Scanning:  Cambridge Cognition has monitoring and scanning 
systems in place in relation to emails sent and received to: monitor / record 
business communications; prevent and detect crime; investigate the use of the 
Company's internal and external email system; and provide evidence of 
compliance with business practices.

Cambridge Cognition Limited
Company Registration Number 4338746
Registered address:
Tunbridge Court
Tunbridge Lane
Bottisham
Cambridge
CB25 9TU
UK
**********************************************************************

_______________________________________________
aspectj-users mailing list
[email protected]
https://dev.eclipse.org/mailman/listinfo/aspectj-users

Reply via email to