Search in sources :

Example 1 with AppDailyDataCenter

use of com.sohu.cache.stats.app.AppDailyDataCenter in project cachecloud by sohutv.

the class AppDailyJob method action.

@Override
public void action(JobExecutionContext context) {
    try {
        SchedulerContext schedulerContext = context.getScheduler().getContext();
        ApplicationContext applicationContext = (ApplicationContext) schedulerContext.get(APPLICATION_CONTEXT_KEY);
        AppDailyDataCenter appDailyDataCenter = applicationContext.getBean("appDailyDataCenter", AppDailyDataCenter.class);
        appDailyDataCenter.sendAppDailyEmail();
    } catch (SchedulerException e) {
        logger.error(e.getMessage(), e);
    }
}
Also used : ApplicationContext(org.springframework.context.ApplicationContext) SchedulerException(org.quartz.SchedulerException) AppDailyDataCenter(com.sohu.cache.stats.app.AppDailyDataCenter) SchedulerContext(org.quartz.SchedulerContext)

Aggregations

AppDailyDataCenter (com.sohu.cache.stats.app.AppDailyDataCenter)1 SchedulerContext (org.quartz.SchedulerContext)1 SchedulerException (org.quartz.SchedulerException)1 ApplicationContext (org.springframework.context.ApplicationContext)1