package com.zswl.cloud.springBtach.server.core.service;

import org.springframework.batch.core.Job;
import org.springframework.stereotype.Service;

import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;

/**
 * @author wy
 */
@Service
public class JobRegisterService {

    private final Map<String, Job> jobMap = new ConcurrentHashMap<>();

    public void registerJob(String jobName, Job job) {
        jobMap.put(jobName, job);
    }

    public Job getJob(String jobName) {
        return jobMap.get(jobName);
    }
}
