package com.jwipc.job.config;

import org.quartz.JobExecutionContext;
import org.quartz.JobExecutionException;
import org.quartz.JobListener;
import org.springframework.stereotype.Component;

/**
 * <p> </p>
 *
 * @author ZhangJie
 * @version 1.0
 * @since JDK 1.8
 */
@Component
public class JobsListener implements JobListener {

    @Override
    public String getName() {
        return "globalJob";
    }

    @Override
    public void jobToBeExecuted(JobExecutionContext context) {
    }

    @Override
    public void jobExecutionVetoed(JobExecutionContext context) {
    }

    @Override
    public void jobWasExecuted(JobExecutionContext context, JobExecutionException jobException) {
//        final ITaskService taskService = SpringContextHolder.getBean(ITaskService.class);
//        final String jobName = context.getJobDetail().getKey().getName();
//        final String description = context.getJobDetail().getDescription();
//        taskService.saveLog(jobName,description);
    }
}
