Adding reference article to Lokesh's comment. This will further help you.
The Run() will execute preodically as mnetioned in scheduler.expression (add you code to check for the expire date across the asset nodes)
Link:- http://hashimkhan.in/aem-adobecq5-code-templates/scheduler/
// Covering following topics:-
What is a Scheduler?
How to Write a Scheduler?
Sample Scheduler Templates
@Component(immediate=true)
@Service(interface=”java.lang.Runnable”)
@Property(name=”scheduler.expression” value=”0 0/10 * * * ?”, type=”String”)
public class MyScheduledJob implements java.lang.Runnable {
public void run() {
// code to execute goes here
}
}
I hope this would help you.
Thanks and Regards
Kautuk Sahni
Kautuk Sahni