All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.github.ltsopensource.example.springboot.JobCompletedHandlerImpl Maven / Gradle / Ivy

The newest version!
package com.github.ltsopensource.example.springboot;

import com.github.ltsopensource.core.commons.utils.CollectionUtils;
import com.github.ltsopensource.core.domain.JobResult;
import com.github.ltsopensource.jobclient.support.JobCompletedHandler;
import com.github.ltsopensource.spring.boot.annotation.JobCompletedHandler4JobClient;

import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.List;

/**
 * @author Robert HG ([email protected]) on 4/9/16.
 */
@JobCompletedHandler4JobClient
public class JobCompletedHandlerImpl implements JobCompletedHandler {
    @Override
    public void onComplete(List jobResults) {
        // 任务执行反馈结果处理
        if (CollectionUtils.isNotEmpty(jobResults)) {
            for (JobResult jobResult : jobResults) {
                System.out.println(new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(new Date()) + " 任务执行完成:" + jobResult);
            }
        }
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy