May 10, 2020
Estimated Post Reading Time ~

Schedulers in AEM 6.4

1. Implement an @interface with @ObjectClassDefinition annotation. Let's name it SchedulerConfiguration 
2. Provide properties like schedulerName, enabled, cronExpression, and other parameters if required to be configured in config manager
3. Now, implement a scheduler class that implements runnable with @component and @designate as the class annotations
4. Implement @Activate activate(SchedulerConfiguration config), @Deactivate deactivate(..), @Modified modified(..) methods
5. Add scheduler using - scheduler.schedule(this, scheduleOptions) here schedule options will be taken from cronExpression on SchedulerConfiguration.
6. Override run method (required for ruunable interface)


By aem4beginner

No comments:

Post a Comment

If you have any doubts or questions, please let us know.