Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[aspectj-users] newbie question on within pointcut

In the following aspect, the bolded methods cause infinite recursion due to re-invocation of the pointcut.  I don't get it: the pointcut conditions include


 !within(ApplyStatisticsDaoAllPublicMethodsAspect) 

So why did that not avoid the recursion?


@Aspect
public class ApplyStatisticsDaoAllPublicMethodsAspect {

@Aspect
public class ApplyStatisticsDaoAllPublicMethodsAspect {

@Around(value = "execution(public * WaterfallOrmDao+.find* (..)) && !within(ApplyStatisticsDaoAllPublicMethodsAspect) && this(dao)", argNames = "thisJoinPoint, dao")
  public Object aroundApplyStatisticsMethod (ProceedingJoinPoint thisJoinPoint, WaterfallORMDao dao)
    throws Throwable {

..
        executedMethod = ((MethodSignature)thisJoinPoint.getSignature()).getMethod();
        STATISTICS_FACTORY.getStatistics().addStatLine(dao.getManagedClass(), executedMethod, dao.getStatisticsSource(), stop - start);
     LOG.warn(dao.getManagedClass()+" "+ executedMethod+" "+ dao.getStatisticsSource()+" " + (stop - start));
 ..  


Back to the top