use of com.dangdang.ddframe.job.exception.JobStatisticException in project elastic-job by dangdangdotcom.
the class StatisticsScheduler method register.
/**
* 注册统计作业.
*
* @param statisticJob 统计作业
*/
void register(final StatisticJob statisticJob) {
try {
JobDetail jobDetail = statisticJob.buildJobDetail();
Map<String, Object> dataMap = statisticJob.getDataMap();
for (String each : dataMap.keySet()) {
jobDetail.getJobDataMap().put(each, dataMap.get(each));
}
scheduler.scheduleJob(jobDetail, statisticJob.buildTrigger());
} catch (final SchedulerException ex) {
throw new JobStatisticException(ex);
}
}
use of com.dangdang.ddframe.job.exception.JobStatisticException in project elastic-job by dangdangdotcom.
the class StatisticsScheduler method start.
/**
* 启动调度器.
*/
void start() {
try {
scheduler = factory.getScheduler();
scheduler.start();
} catch (final SchedulerException ex) {
throw new JobStatisticException(ex);
}
}
Aggregations