BAEL-20262: Migrate spring-scheduling module to the com.baeldung package

This commit is contained in:
Krzysztof Woyke 2019-12-20 12:47:57 +01:00
parent 015d9b3f81
commit c69b2a5ca3
23 changed files with 29 additions and 40 deletions

View File

@ -1,4 +1,4 @@
package org.baeldung.async; package com.baeldung.async;
import org.springframework.scheduling.annotation.Async; import org.springframework.scheduling.annotation.Async;
import org.springframework.scheduling.annotation.AsyncResult; import org.springframework.scheduling.annotation.AsyncResult;

View File

@ -1,4 +1,4 @@
package org.baeldung.async; package com.baeldung.async;
import java.lang.reflect.Method; import java.lang.reflect.Method;

View File

@ -1,8 +1,8 @@
package org.baeldung.async.config; package com.baeldung.async.config;
import java.util.concurrent.Executor; import java.util.concurrent.Executor;
import org.baeldung.async.CustomAsyncExceptionHandler; import com.baeldung.async.CustomAsyncExceptionHandler;
import org.springframework.aop.interceptor.AsyncUncaughtExceptionHandler; import org.springframework.aop.interceptor.AsyncUncaughtExceptionHandler;
import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.ComponentScan; import org.springframework.context.annotation.ComponentScan;
@ -14,7 +14,7 @@ import org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor;
@Configuration @Configuration
@EnableAsync() @EnableAsync()
@ComponentScan("org.baeldung.async") @ComponentScan("com.baeldung.async")
public class SpringAsyncConfig implements AsyncConfigurer { public class SpringAsyncConfig implements AsyncConfigurer {
@Bean(name = "threadPoolTaskExecutor") @Bean(name = "threadPoolTaskExecutor")

View File

@ -1,4 +1,4 @@
package org.baeldung.scheduling; package com.baeldung.scheduling;
import org.springframework.scheduling.annotation.Scheduled; import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component; import org.springframework.stereotype.Component;

View File

@ -1,4 +1,4 @@
package org.baeldung.scheduling; package com.baeldung.scheduling;
public class SchedulingWithXmlConfig { public class SchedulingWithXmlConfig {

View File

@ -1,4 +1,4 @@
package org.baeldung.scheduling; package com.baeldung.scheduling;
import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.ComponentScan; import org.springframework.context.annotation.ComponentScan;
@ -9,7 +9,7 @@ import org.springframework.scheduling.annotation.EnableScheduling;
@Configuration @Configuration
@EnableScheduling @EnableScheduling
@ComponentScan("org.baeldung.scheduling") @ComponentScan("com.baeldung.scheduling")
@PropertySource("classpath:springScheduled.properties") @PropertySource("classpath:springScheduled.properties")
public class SpringSchedulingConfig { public class SpringSchedulingConfig {

View File

@ -1,12 +0,0 @@
package com.baeldung.scheduling;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.Configuration;
import org.springframework.scheduling.annotation.EnableScheduling;
@Configuration
@EnableScheduling
@ComponentScan("com.baeldung.scheduling")
public class SpringSchedulingFixedRateConfig {
}

View File

@ -1,4 +1,4 @@
package org.baeldung.springretry; package com.baeldung.springretry;
import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.ComponentScan; import org.springframework.context.annotation.ComponentScan;
@ -9,7 +9,7 @@ import org.springframework.retry.policy.SimpleRetryPolicy;
import org.springframework.retry.support.RetryTemplate; import org.springframework.retry.support.RetryTemplate;
@Configuration @Configuration
@ComponentScan(basePackages = "org.baeldung.springretry") @ComponentScan(basePackages = "com.baeldung.springretry")
@EnableRetry @EnableRetry
// Uncomment this two lines if we need XML configuration // Uncomment this two lines if we need XML configuration
// @EnableAspectJAutoProxy // @EnableAspectJAutoProxy

View File

@ -1,4 +1,4 @@
package org.baeldung.springretry; package com.baeldung.springretry;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;

View File

@ -1,4 +1,4 @@
package org.baeldung.springretry; package com.baeldung.springretry;
import java.sql.SQLException; import java.sql.SQLException;

View File

@ -1,4 +1,4 @@
package org.baeldung.springretry; package com.baeldung.springretry;
import java.sql.SQLException; import java.sql.SQLException;

View File

@ -1,4 +1,4 @@
package org.baeldung.taskscheduler; package com.baeldung.taskscheduler;
import java.util.concurrent.TimeUnit; import java.util.concurrent.TimeUnit;
@ -10,7 +10,7 @@ import org.springframework.scheduling.support.CronTrigger;
import org.springframework.scheduling.support.PeriodicTrigger; import org.springframework.scheduling.support.PeriodicTrigger;
@Configuration @Configuration
@ComponentScan(basePackages = "org.baeldung.taskscheduler", basePackageClasses = { ThreadPoolTaskSchedulerExamples.class }) @ComponentScan(basePackages = "com.baeldung.taskscheduler", basePackageClasses = { ThreadPoolTaskSchedulerExamples.class })
public class ThreadPoolTaskSchedulerConfig { public class ThreadPoolTaskSchedulerConfig {
@Bean @Bean

View File

@ -1,4 +1,4 @@
package org.baeldung.taskscheduler; package com.baeldung.taskscheduler;
import java.util.Date; import java.util.Date;

View File

@ -7,7 +7,7 @@
http://www.springframework.org/schema/beans/spring-beans.xsd"> http://www.springframework.org/schema/beans/spring-beans.xsd">
<aop:config> <aop:config>
<aop:pointcut id="transactional" <aop:pointcut id="transactional"
expression="execution(* org.baeldung.springretry..*MyService.defaultXmlRetryService(..))" /> expression="execution(* com.baeldung.springretry..*MyService.defaultXmlRetryService(..))" />
<aop:advisor pointcut-ref="transactional" advice-ref="taskRetryAdvice" order="-1" /> <aop:advisor pointcut-ref="transactional" advice-ref="taskRetryAdvice" order="-1" />
</aop:config> </aop:config>

View File

@ -10,6 +10,6 @@
<task:annotation-driven executor="myExecutor"/> <task:annotation-driven executor="myExecutor"/>
<task:executor id="myExecutor" pool-size="5"/> <task:executor id="myExecutor" pool-size="5"/>
<bean id="asyncAnnotationExample" class="org.baeldung.async.AsyncComponent"/> <bean id="asyncAnnotationExample" class="com.baeldung.async.AsyncComponent"/>
</beans> </beans>

View File

@ -16,7 +16,7 @@
<bean id="myscheduler" class="org.springframework.scheduling.concurrent.ThreadPoolTaskScheduler"/> <bean id="myscheduler" class="org.springframework.scheduling.concurrent.ThreadPoolTaskScheduler"/>
<!-- Configure the fixedDealy, fixedRate or cron based scheduled tasks --> <!-- Configure the fixedDealy, fixedRate or cron based scheduled tasks -->
<bean id="schedulingWithXmlConfig" class="org.baeldung.scheduling.SchedulingWithXmlConfig"/> <bean id="schedulingWithXmlConfig" class="com.baeldung.scheduling.SchedulingWithXmlConfig"/>
<task:scheduled-tasks scheduler="myScheduler"> <task:scheduled-tasks scheduler="myScheduler">
<task:scheduled ref="schedulingWithXmlConfig" method="scheduleFixedDelayTask" <task:scheduled ref="schedulingWithXmlConfig" method="scheduleFixedDelayTask"

View File

@ -1,9 +1,9 @@
package org.baeldung.async; package com.baeldung.async;
import java.util.concurrent.ExecutionException; import java.util.concurrent.ExecutionException;
import java.util.concurrent.Future; import java.util.concurrent.Future;
import org.baeldung.async.config.SpringAsyncConfig; import com.baeldung.async.config.SpringAsyncConfig;
import org.junit.Test; import org.junit.Test;
import org.junit.runner.RunWith; import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;

View File

@ -1,4 +1,4 @@
package org.baeldung.async; package com.baeldung.async;
import org.junit.Test; import org.junit.Test;
import org.junit.runner.RunWith; import org.junit.runner.RunWith;

View File

@ -1,5 +1,6 @@
package org.baeldung.scheduling; package com.baeldung.scheduling;
import com.baeldung.scheduling.SpringSchedulingConfig;
import org.junit.Test; import org.junit.Test;
import org.junit.runner.RunWith; import org.junit.runner.RunWith;
import org.springframework.test.context.ContextConfiguration; import org.springframework.test.context.ContextConfiguration;

View File

@ -7,7 +7,7 @@ import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
import org.springframework.test.context.support.AnnotationConfigContextLoader; import org.springframework.test.context.support.AnnotationConfigContextLoader;
@RunWith(SpringJUnit4ClassRunner.class) @RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration(classes = { SpringSchedulingFixedRateConfig.class }, loader = AnnotationConfigContextLoader.class) @ContextConfiguration(classes = { SpringSchedulingConfig.class }, loader = AnnotationConfigContextLoader.class)
public class ScheduledFixedRateExampleIntegrationTest { public class ScheduledFixedRateExampleIntegrationTest {
@Test @Test

View File

@ -1,4 +1,4 @@
package org.baeldung.scheduling; package com.baeldung.scheduling;
import org.junit.Test; import org.junit.Test;
import org.junit.runner.RunWith; import org.junit.runner.RunWith;

View File

@ -1,4 +1,4 @@
package org.baeldung.springretry; package com.baeldung.springretry;
import org.junit.Test; import org.junit.Test;
import org.junit.runner.RunWith; import org.junit.runner.RunWith;

View File

@ -1,4 +1,4 @@
package org.baeldung.taskscheduler; package com.baeldung.taskscheduler;
import org.junit.Test; import org.junit.Test;
import org.junit.runner.RunWith; import org.junit.runner.RunWith;