7

で注釈が付けられたメソッドの AspectJ ポイントカットが必要です@Scheduled。さまざまなアプローチを試みましたが、何も機能しませんでした。

1.)

@Pointcut("execution(@org.springframework.scheduling.annotation.Scheduled * * (..))")
public void scheduledJobs() {}

@Around("scheduledJobs()")
public Object profileScheduledJobs(ProceedingJoinPoint joinPoint) throws Throwable {
    LOG.info("testing")
}

2.)

@Pointcut("within(@org.springframework.scheduling.annotation.Scheduled *)")
public void scheduledJobs() {}

@Pointcut("execution(public * *(..))")
public void publicMethod() {}

@Around("scheduledJobs() && publicMethod()")
public Object profileScheduledJobs(ProceedingJoinPoint joinPoint) throws Throwable {
    LOG.info("testing")
}

注釈付きの方法についてaround/beforeアドバイスする他の方法を誰かが提案できますか?@Scheduled

4

1 に答える 1