Expand my Community achievements bar.

Guidelines for the Responsible Use of Generative AI in the Experience Cloud Community.
SOLVED

Scheduler : example code

Avatar

Level 9

Hi All,

Can someone please provide a sample code/link as to how the schedulers[a specific job to be scheduled once or at regular intervals within CQ5] are made use of.

I have a sling servlet code that needs to be scheduled.

Have gone through through some links below, but not getting how to implement.

http://chanchal.wordpress.com/2013/06/26/scheduled-and-background-jobs-in-cq5-sling/

http://dev.day.com/content/ddc/blog/2010/02/the_apache_slingsch.html

Any thoughts/pointers will be really helpful.

1 Accepted Solution

Avatar

Correct answer by
Level 10
7 Replies

Avatar

Level 10

We will extend the MBean article into a Sling Scheduler article by Fri of this week (May 23). I will post the link on this thread once done. 

Avatar

Level 10

your references looks good and let us know if you have any specific issues while configuring the schedulers.

 

Use for time interval : this.scheduler.addPeriodicJob(pollerName, job, config, period, canRunConcurrently, startImmediate);

or

Use for specific scheduling expression : this.scheduler.addJob(pollerName, job, config, schedulingExpression, canRunConcurrently);

 

 

~Lok!

Avatar

Level 9

Hi All,

Also, is it possible to directly schedule a bundle , that is installed in CQ.

Any thoughts will be helpful.

Avatar

Correct answer by
Level 10

Here is the article that addresses this use case:

http://helpx.adobe.com/experience-manager/using/aem-first-components1.html

Avatar

Level 9

Hi All,.

I did fine one relevant article in the link

http://dev.day.com/content/ddc/blog/2010/02/the_apache_slingsch.html

I have the code on my eclipse and I have the AEM instance too.

However, I am not quite getting as to what should I do further with this..

Any thoughts/pointers will be helpful.

Avatar

Level 9

Hi Jorg/Lokesh,

Thank you for your reply. Sorry for the delayed response.

Yes, the article in the link I was referring was working fine, but I was foolish enough not to observe the logs etc.

Avatar

Employee Advisor

Hi,

I think that article is fine. What's the specific problem you encountered?

Jörg