[aspectwerkz-user] how to do this?

Manuel <[email protected]> Fri, 17 Mar 2006 00:59:43 -0800 (PST)
Newsgroups gmane.comp.java.aspectwerkz.user
Message-ID <[email protected]>
Hello, I am quite a newbie, and I'm trying to implement a tracing aspect.
Inside my advice code, I print 'this' with this simple statement, inside my aspect methods beginMethod() and endMethod():
System.out.println(indent+"this: "+joinPoint.getThis().hashCode())

This is how my aop.xml looks like:
<package name="test">
    <aspect class="PortalAspect">
      <pointcut name="traceAll" expression="execution(* *..*.*(..)) AND within(com.bla.*)"/>
    <advice name="beginMethod" type="before" bind-to="traceAll"/>
    <advice name="endMethod" type="after" bind-to="traceAll"/>
  </aspect>
</package>



The problem is, when it tries to print 'this', it goes into an infinite recursion at the toString methods. Since I am not interested actually in what goes on in the toString methods, I'd like to write an expression of execution (* *..*.!toString(..)), but this doesn't work. I want to trace entering and exiting of all methods, excluding toString(), or including toString(), if that doesn't imply an infinite recursion. How may I do this? Is it possible in the form of an expression? Is the cflow construct useful for this? 

Please enlighten me,
Thank you very much!

		
---------------------------------
Yahoo! Mail
Bring photos to life! New PhotoMail  makes sharing a breeze.