>
pointcut CircleLog(Circle c) : target(c)
&& execution(* *.* (..))
&& !within(CircleLog);
<execution --> call

解决方案 »

  1.   

    什么时候用call 什么时候用execution现在还不能理解
      

  2.   

    call  vs.  execution  
     So  what's  the  difference  between  these  join  points?  Well,  there  are  a  number  of  differences:    
     
    Firstly,  the  lexical  pointcut  declarations  within  and  withincode  match  differently.  At  a  call  join  point,  the  enclosing  code  is  that  of  the  call  site.  This  means  that  call(void  m())  &&  withincode(void  m())  will  only  capture  directly  recursive  calls,  for  example.  At  an  execution  join  point,  however,  the  program  is  already  executing  the  method,  so  the  enclosing  code  is  the  method  itself:  execution(void  m())  &&  withincode(void  m())  is  the  same  as  execution(void  m()).    
     
    Secondly,  the  call  join  point  does  not  capture  super  calls  to  non-static  methods.  This  is  because  such  super  calls  are  different  in  Java,  since  they  don't  behave  via  dynamic  dispatch  like  other  calls  to  non-static  methods.    
     
    The  rule  of  thumb  is  that  if  you  want  to  pick  a  join  point  that  runs  when  an  actual  piece  of  code  runs  (as  is  often  the  case  for  tracing),  use  execution,  but  if  you  want  to  pick  one  that  runs  when  a  particular  signature  is  called  (as  is  often  the  case  for  production  aspects),  use  call.
      

  3.   

    最后一段,当运行实际的代码如跟踪记录,用execution;当运行特殊点如产品方面,用call******不明白,如果日志记录用execution,就不能避免死循环么?
      

  4.   

    执行(execution)到c.getArea()内部那肯定是within(Circle)的呀。