Sunday, February 17, 2019

Creating Scheduler in AEM 6.4

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

Some more AEM 6 Interview Questions for Architects

 Some more AEM 6 Interview Questions for Architects 1. Consider you have a workflow with two steps. One step is to transfer the asset from s...