@@ -0,0 +1,2074 @@
+package com.lts.job.queue.mysql;%0A%0Aimport com.lts.job.core.cluster.Config;%0Aimport com.lts.job.core.file.FileUtils;%0Aimport com.lts.job.core.util.DateUtils;%0Aimport com.lts.job.core.util.JobQueueUtils;%0Aimport com.lts.job.queue.CronJobQueue;%0Aimport com.lts.job.queue.domain.JobPo;%0Aimport com.lts.job.queue.exception.JobQueueException;%0Aimport com.lts.job.queue.mysql.support.ResultSetHandlerHolder;%0A%0Aimport java.io.InputStream;%0Aimport java.sql.SQLException;%0A%0A/**%0A * @author Robert HG (254963746@qq.com) on 5/31/15.%0A */%0Apublic class MysqlCronJobQueue extends AbstractMysqlJobQueue implements CronJobQueue %7B%0A%0A    public MysqlCronJobQueue(Config config) %7B%0A        super(config);%0A        // create table%0A        try %7B%0A            InputStream is = this.getClass().getClassLoader().getResourceAsStream(%22sql/lts_cron_job_queue.sql%22);%0A            String sql = FileUtils.read(is);%0A            sql = sql.replace(%22%7BtableName%7D%22, JobQueueUtils.CRON_JOB_QUEUE);%0A            getSqlTemplate().update(sql);%0A        %7D catch (Exception e) %7B%0A            throw new JobQueueException(%22create table error!%22, e);%0A        %7D%0A    %7D%0A%0A    @Override%0A    public boolean add(JobPo jobPo) %7B%0A        jobPo.setGmtCreated(DateUtils.currentTimeMillis());%0A        jobPo.setGmtModified(jobPo.getGmtCreated());%0A        return super.add(JobQueueUtils.CRON_JOB_QUEUE, jobPo);%0A    %7D%0A%0A    @Override%0A    public JobPo finish(String jobId) %7B%0A        String sql = %22SELECT * FROM %60%7BtableName%7D%60 WHERE job_id = ?%22.replace(%22%7BtableName%7D%22, JobQueueUtils.CRON_JOB_QUEUE);%0A        try %7B%0A            return getSqlTemplate().query(sql, ResultSetHandlerHolder.JOB_PO_RESULT_SET_HANDLER, jobId);%0A        %7D catch (SQLException e) %7B%0A            throw new JobQueueException(e);%0A        %7D%0A    %7D%0A%0A    @Override%0A    public boolean remove(String jobId) %7B%0A        String sql = %22DELETE FROM %60%7BtableName%7D%60 WHERE job_id = ?%22.replace(%22%7BtableName%7D%22, JobQueueUtils.CRON_JOB_QUEUE);%0A        try %7B%0A            return getSqlTemplate().update(sql, jobId) == 0;%0A        %7D catch (SQLException e) %7B%0A            throw new JobQueueException(e);%0A        %7D%0A    %7D%0A%7D%0A

Create MysqlCronJobQueue.java