Rev 23759 | Go to most recent revision | Blame | Compare with Previous | Last modification | View Log | RSS feed
package com.smartdukaan.cron.scheduled;import org.apache.logging.log4j.LogManager;import org.apache.logging.log4j.Logger;import org.springframework.beans.factory.annotation.Autowired;import org.springframework.scheduling.annotation.Scheduled;import org.springframework.stereotype.Component;import com.smartdukaan.cron.migrations.RunOnceTasks;import com.smartdukaan.cron.monitored.NagiosMonitorTasks;@Componentpublic class ScheduledSkeleton {private static final Logger log = LogManager.getLogger(ScheduledSkeleton.class);@AutowiredScheduledTasks scheduledTasks;@AutowiredNagiosMonitorTasks nagiosMonitorTasks;@AutowiredRunOnceTasks runOnceTasks;@Scheduled(cron = "1 00 * * * *")public void generateDailyRecharge() {scheduledTasks.generateDailyRecharge();}/*@Scheduled(cron = "0 45 0 * * *")public void processScheme() throws Exception {scheduledTasks.processScheme();}*/@Scheduled(cron = "0 45 * * * *")public void reconcileRecharge() throws Exception {scheduledTasks.reconcileRecharge();}@Scheduled(cron = "0 05 12 1,16 * ?")public void processRechargeCashback() throws Throwable {scheduledTasks.processRechargeCashback();nagiosMonitorTasks.reportSmsCount();}/*Value so big so that it got to run only once.**/@Scheduled(fixedRate=Integer.MAX_VALUE)public void runOnce() throws Throwable{log.info("Started run Once");runOnceTasks.migarateLineItemsToNewTable();}@Scheduled(fixedRate=Integer.MAX_VALUE)public void runTwice() throws Throwable{log.info("Started run Twice");scheduledTasks.reconcileRecharge();}@Scheduled(fixedRate=Integer.MAX_VALUE)public void runThird() throws Throwable{log.info("Started run Third");scheduledTasks.generateDailyRecharge();}}