Creating Scheduler 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)
No comments:
Post a Comment