public class LuceneIndexer implements Indexer {
@Override
public void startIndex() {
try {
JobDetail job = newJob(com.google.code.ftspc.lector.indexers.Lucene.LuceneTimerForFilesChecking.class).
withIdentity("jobForIndexer", "Lector").build();
CronTrigger trigger = newTrigger().
withIdentity("triggerForIndexer", "Lector").
withSchedule(cronSchedule(Vars.CronExpressionForIndexer)).build();
Date ft = Vars.sched.scheduleJob(job, trigger);
System.out.println(job.getKey() + " has been scheduled to run at: " + ft
+ " and repeat based on expression: "
+ trigger.getCronExpression());
} catch (Exception ex) {
Vars.logger.warn(ex.getMessage(), ex);
}