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

com.github.rexsheng.springboot.faster.system.job.adapter.JobModule Maven / Gradle / Ivy

The newest version!
package com.github.rexsheng.springboot.faster.system.job.adapter;

import com.github.rexsheng.springboot.faster.system.job.application.JobHistoryLogger;
import com.github.rexsheng.springboot.faster.system.job.application.JobServiceImpl;
import com.github.rexsheng.springboot.faster.system.job.application.TriggerServiceImpl;
import com.github.rexsheng.springboot.faster.system.job.infrastructure.JobGatewayImpl;
import com.github.rexsheng.springboot.faster.system.modular.SpringModule;
import org.quartz.Scheduler;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.InitializingBean;
import org.springframework.boot.autoconfigure.condition.ConditionalOnClass;
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
import org.springframework.context.annotation.Import;

@ConditionalOnClass(Scheduler.class)
@ConditionalOnProperty(prefix = "app.module.job",name = "enabled",havingValue = "true",matchIfMissing = false)
@Import({
        JobHistoryLogger.class,
        StartupListener.class,
        JobController.class,
        JobServiceImpl.class,
        TriggerServiceImpl.class,
        JobGatewayImpl.class
})
@SpringModule
public class JobModule implements InitializingBean {

    private static final Logger logger= LoggerFactory.getLogger(JobModule.class);

    @Override
    public void afterPropertiesSet() throws Exception {
        logger.info("已启动模块: {}", "Job");
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy