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