package com.ozs.da.job;

import com.ozs.da.entity.model.ScheduleRoundEvent;
import com.ozs.da.service.job.JobPutService;
import com.lmax.disruptor.WorkHandler;
import org.springframework.beans.factory.annotation.Autowired;

/**
 * @author 许明
 * on 2019/3/6.
 * @version 2.0.0
 */
public class TestHandler implements WorkHandler<ScheduleRoundEvent> {

    @Autowired
    private JobPutService jobPutService;


    @Override
    public void onEvent(ScheduleRoundEvent event) throws Exception {
//        event.getTask().setTaskName("测试线程1111");
        System.out.println(event.getTask() == null ? "sssss" : event.getTask().getTaskName() + "==================");
//        if(jobPutService == null){
//            System.out.println("spring 工厂没有初始化");
//        }
//        jobPutService.jobRunConditionJudge(event.getTask());
    }
//
//    @Override
//    public void onEvent(ScheduleRoundEvent event, long sequence, boolean endOfBatch) throws Exception {
//        event.getTask().setTaskName("测试线程");
//        System.out.println(event.getTask() == null ? "sssss" : event.getTask().getTaskName() + "==================");
//    }
}
