3. What is Scheduler ???
●
Apache Sling Scheduler enables you to easily
schedule jobs within your application
●
Jobs can be executed at a specific time, regularly
at a given period or at the time given by a cron
expression by leveraging the Sling scheduler
service
4. The scheduler can be used in two ways:
● by registering the job through the scheduler API
● by leveraging the whiteboard pattern that is
supported by the scheduler
How to Write a Scheduler?
6. What is Polling ???
●
Polling is a data importer service for Adobe Experience Manager
(AEM) that lets you import data
●
To address some business requirements, importing external data
into your AEM site is an important use case
9. ● The Sling Event Support adds the notion of a job
● A job is a special event that has to be processed
exactly once
● A job consumer should be prepared to process a
job more than once
Sling Jobs (Guarantee of Processing)
10. Sling Jobs (Guarantee of Processing)
A job consists of two parts, the job topic describing the nature of the job
and the payload which is a key value map of serializable objects.
In Sling jobs,we create
1.Job Producer
2. Job Consumer
Job producer gets created with job name in /var/eventing/unassigned
Job consumer gets created with job name in /var/eventing/assigned
11. Job Producer (Syntax)
@Component
public class Jobs {
@Reference
private JobManager jobManager;
public void startJob() {
final Map<String, Object> props = new HashMap<String, Object>();
props.put("item1", "/something");
props.put("count", 5);
jobManager.addJob("sling/orderedtest/start", props);
}
}