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

org.smart4j.plugin.job.SmartJobFactory Maven / Gradle / Ivy

package org.smart4j.plugin.job;

import org.quartz.Job;
import org.quartz.JobDetail;
import org.quartz.Scheduler;
import org.quartz.SchedulerException;
import org.quartz.spi.JobFactory;
import org.quartz.spi.TriggerFiredBundle;
import org.smart4j.framework.ioc.BeanHelper;

public class SmartJobFactory implements JobFactory {

    @Override
    public Job newJob(TriggerFiredBundle bundle, Scheduler scheduler) throws SchedulerException {
        JobDetail jobDetail = bundle.getJobDetail();
        Class jobClass = jobDetail.getJobClass();
        return BeanHelper.getBean(jobClass);
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy