Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[aspectj-users] [Newbie] How to filter out packages/classes in trace aspect

All,
 
I am trying to use the TraceAspect to document program flow.  I would like to ignore specific packages and in some cases, specific classes.  The notation that I am using below does not appear to be working as expected though.  How can I filter out packages/classes correctly?
 
Regards,
 
Josh
 
 
 
public aspect TraceAspect extends IndentedLogging {

 protected pointcut loggedOperations() : (
   (execution(* *.*(..)) || execution(*.new(..))))
   
   && (
     !execution(* com.mycompany.dbutils..*(..))
     && !execution(* com.mycompany.MySpecificObject.* (..))     
    )      
   && !within(IndentedLogging+
   );
 
 before() : loggedOperations() {
  Signature sig = thisJoinPointStaticPart.getSignature();
  System.out.println("Entering ["
       + sig.getDeclaringType().getName() + "."
       + sig.getName() + "]");
 }
 
}


Back to the top