4
我想要有一个用@Scheduled
批注的方法的AspectJ切入点。尝试不同的方法,但没有奏效。带有@Scheduled Spring批注方法的切入点
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
注解的方法的建议吗?
请使用代码格式下一次。我刚刚解决了这个问题,但是你已经在这里呆了很长时间以了解它。没有冒犯的意思。 :-) – kriegaex