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.AsyncResult;

View File

@ -1,4 +1,4 @@
package org.baeldung.async;
package com.baeldung.async;
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 org.baeldung.async.CustomAsyncExceptionHandler;
import com.baeldung.async.CustomAsyncExceptionHandler;
import org.springframework.aop.interceptor.AsyncUncaughtExceptionHandler;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.ComponentScan;
@ -14,7 +14,7 @@ import org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor;
@Configuration
@EnableAsync()
@ComponentScan("org.baeldung.async")
@ComponentScan("com.baeldung.async")
public class SpringAsyncConfig implements AsyncConfigurer {
@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.stereotype.Component;

View File

@ -1,4 +1,4 @@
package org.baeldung.scheduling;
package com.baeldung.scheduling;
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.ComponentScan;
@ -9,7 +9,7 @@ import org.springframework.scheduling.annotation.EnableScheduling;
@Configuration
@EnableScheduling
@ComponentScan("org.baeldung.scheduling")
@ComponentScan("com.baeldung.scheduling")
@PropertySource("classpath:springScheduled.properties")
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.ComponentScan;
@ -9,7 +9,7 @@ import org.springframework.retry.policy.SimpleRetryPolicy;
import org.springframework.retry.support.RetryTemplate;
@Configuration
@ComponentScan(basePackages = "org.baeldung.springretry")
@ComponentScan(basePackages = "com.baeldung.springretry")
@EnableRetry
// Uncomment this two lines if we need XML configuration
// @EnableAspectJAutoProxy

View File

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

View File

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

View File

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

View File

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

View File

@ -7,7 +7,7 @@
http://www.springframework.org/schema/beans/spring-beans.xsd">
<aop:config>
<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:config>

View File

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

View File

@ -16,7 +16,7 @@
<bean id="myscheduler" class="org.springframework.scheduling.concurrent.ThreadPoolTaskScheduler"/>
<!-- 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 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.Future;
import org.baeldung.async.config.SpringAsyncConfig;
import com.baeldung.async.config.SpringAsyncConfig;
import org.junit.Test;
import org.junit.runner.RunWith;
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.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.runner.RunWith;
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;
@RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration(classes = { SpringSchedulingFixedRateConfig.class }, loader = AnnotationConfigContextLoader.class)
@ContextConfiguration(classes = { SpringSchedulingConfig.class }, loader = AnnotationConfigContextLoader.class)
public class ScheduledFixedRateExampleIntegrationTest {
@Test

View File

@ -1,4 +1,4 @@
package org.baeldung.scheduling;
package com.baeldung.scheduling;
import org.junit.Test;
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.runner.RunWith;

View File

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