Refine search
/** * @author github.com/zhegexiaohuozi seimimaster@gmail.com * Date: 2015/4/9. */ @Configuration @ImportResource("classpath*:**/seimi*.xml") @EnableScheduling public class SeimiDefScanConfig { }
@SpringBootApplication @EnableScheduling public class Application { public static void main(String[] args) { SpringApplication.run(Application.class, args); } }
@SpringBootApplication @EnableScheduling public class GeekQMainApplication {
@Configuration @EnableScheduling static class FixedRateTaskConfig_withInitialDelay { @Bean public AtomicInteger counter() { return new AtomicInteger(); } @Scheduled(initialDelay = 1000, fixedRate = 100) public void task() { counter().incrementAndGet(); } }
/** * Hello world! * * @author xxc */ @EnableScheduling @SpringBootApplication public class NamingApp { public static void main(String[] args) { SpringApplication.run(NamingApp.class, args); } }
@Configuration @EnableScheduling static class AspectConfig { @Bean public static AnnotationAwareAspectJAutoProxyCreator autoProxyCreator() { AnnotationAwareAspectJAutoProxyCreator apc = new AnnotationAwareAspectJAutoProxyCreator(); apc.setProxyTargetClass(true); return apc; } @Bean public static MyAspect myAspect() { return new MyAspect(); } }
/** * Config main * * @author Nacos */ @EnableScheduling @SpringBootApplication public class Config { public static void main(String[] args) throws UnknownHostException { SpringApplication.run(Config.class, args); } }
@Configuration @EnableScheduling static class FixedRateTaskConfig implements SchedulingConfigurer { @Override public void configureTasks(ScheduledTaskRegistrar taskRegistrar) { taskRegistrar.addFixedRateTask(() -> {}, 100); } @Bean public AtomicInteger counter() { return new AtomicInteger(); } @Scheduled(fixedRate = 10) public void task() { counter().incrementAndGet(); } }
@SpringBootApplication @MapperScan({"com.macro.mall.mapper","com.macro.mall.portal.dao"}) @EnableScheduling public class MallPortalApplication { public static void main(String[] args) { SpringApplication.run(MallPortalApplication.class, args); } }
@Configuration @EnableScheduling static class Config { @Bean public PlatformTransactionManager txManager() { return new CallCountingTransactionManager(); } @Bean public PersistenceExceptionTranslator peTranslator() { return mock(PersistenceExceptionTranslator.class); } @Bean public static PersistenceExceptionTranslationPostProcessor peTranslationPostProcessor() { return new PersistenceExceptionTranslationPostProcessor(); } }
@SpringBootApplication(scanBasePackages = {"org.linlinjava.litemall"}) @MapperScan("org.linlinjava.litemall.db.dao") @EnableTransactionManagement @EnableScheduling public class Application { public static void main(String[] args) throws Exception { SpringApplication.run(Application.class, args); } }
@Configuration @EnableScheduling static class SchedulingEnabled_withAmbiguousTaskSchedulers_butNoActualTasks { @Bean public TaskScheduler taskScheduler1() { ThreadPoolTaskScheduler scheduler = new ThreadPoolTaskScheduler(); scheduler.setThreadNamePrefix("explicitScheduler1"); return scheduler; } @Bean public TaskScheduler taskScheduler2() { ThreadPoolTaskScheduler scheduler = new ThreadPoolTaskScheduler(); scheduler.setThreadNamePrefix("explicitScheduler2"); return scheduler; } }
@SpringBootApplication(scanBasePackages = {"org.linlinjava.litemall.db", "org.linlinjava.litemall.core", "org.linlinjava.litemall.wx"}) @MapperScan("org.linlinjava.litemall.db.dao") @EnableTransactionManagement @EnableScheduling public class Application { public static void main(String[] args) { SpringApplication.run(Application.class, args); } }
/** * @author github.com/zhegexiaohuozi seimimaster@gmail.com * @since 2018/5/8. */ @Configuration @ImportResource("classpath*:**/seimi*.xml") @EnableScheduling public class SeimiCrawlerBaseConfig { @Bean @Conditional(StandaloneCondition.class) public RedissonClient initRedisson(){ SeimiConfig config = CrawlerCache.getConfig(); if (config == null||!config.isEnableRedissonQueue()){ return null; } return Redisson.create(config.getRedissonConfig()); } }
@SpringBootApplication @EnableScheduling public class SpringbootSchedulingTasksApplication { public static void main(String[] args) { SpringApplication.run(SpringbootSchedulingTasksApplication.class, args); } }
@Configuration @EnableScheduling static class AmbiguousExplicitSchedulerConfig { @Bean public TaskScheduler taskScheduler1() { ThreadPoolTaskScheduler scheduler = new ThreadPoolTaskScheduler(); scheduler.setThreadNamePrefix("explicitScheduler1"); return scheduler; } @Bean public TaskScheduler taskScheduler2() { ThreadPoolTaskScheduler scheduler = new ThreadPoolTaskScheduler(); scheduler.setThreadNamePrefix("explicitScheduler2"); return scheduler; } @Scheduled(fixedRate = 10) public void task() { } }
@SpringBootApplication(scanBasePackages = {"org.linlinjava.litemall.db", "org.linlinjava.litemall.core", "org.linlinjava.litemall.admin"}) @MapperScan("org.linlinjava.litemall.db.dao") @EnableTransactionManagement @EnableScheduling public class Application { public static void main(String[] args) { SpringApplication.run(Application.class, args); } }
@Configuration @EnableScheduling static class SchedulingEnabled_withAmbiguousTaskSchedulers_andSingleTask { @Scheduled(fixedRate = 10L) public void task() { } @Bean public TaskScheduler taskScheduler1() { ThreadPoolTaskScheduler scheduler = new ThreadPoolTaskScheduler(); scheduler.setThreadNamePrefix("explicitScheduler1"); return scheduler; } @Bean public TaskScheduler taskScheduler2() { ThreadPoolTaskScheduler scheduler = new ThreadPoolTaskScheduler(); scheduler.setThreadNamePrefix("explicitScheduler2"); return scheduler; } }
/** * */ @SpringBootApplication @EnableScheduling public class App { public static void main(String[] args) { SpringApplication.run(App.class, args); } }
@Configuration @EnableScheduling static class ExplicitSchedulerConfig { String threadName; @Bean public TaskScheduler myTaskScheduler() { ThreadPoolTaskScheduler scheduler = new ThreadPoolTaskScheduler(); scheduler.setThreadNamePrefix("explicitScheduler-"); return scheduler; } @Bean public AtomicInteger counter() { return new AtomicInteger(); } @Scheduled(fixedRate = 10) public void task() { threadName = Thread.currentThread().getName(); counter().incrementAndGet(); } }