package com.yonge.cooleshow.task.core;

import org.quartz.Job;
import org.quartz.JobExecutionContext;
import org.quartz.JobExecutionException;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

/**
 * 所有任务必须继承该抽象方法
 */
public abstract class BaseTask implements Job {

	private Logger LOGGER = LoggerFactory.getLogger(BaseTask.class);

	@Override
	public void execute(JobExecutionContext context) throws JobExecutionException {
		try {
			execute();
		} catch (TaskException e) {
			LOGGER.error(e.getMessage(), e);
		}
	}

	public abstract void execute() throws TaskException;
}
