I have following Custom Annotation.
@Target(ElementType.METHOD)
@Retention(RetentionPolicy.RUNTIME)
public @interface Scheduled {
String cron() default "";
.....
Implementation class
@Named
public class JobDefination {
@Scheduled(concurrent = false, cron = "0 0/1 * * * ?")
public void removeHistory(){
.....
}
The Aspect
@Aspect
@Component
public class AspectImple {
@Before("@annotation(com.quartzConfiguration.Scheduled)")
public void beforeImplAnnotation() {
...
}
@Before("execution(* com.job.defination.JobDefination.*()) && @annotation(com.quartzConfiguration.Scheduled)")
public void beforeImpl2() {
...
}
I have tried with above pointcut one by one. But AOP not working when when quartz calling the method. Could someone please help.