BAEL-20262: Migrate spring-scheduling module to the com.baeldung package
This commit is contained in:
parent
015d9b3f81
commit
c69b2a5ca3
|
@ -1,4 +1,4 @@
|
|||
package org.baeldung.async;
|
||||
package com.baeldung.async;
|
||||
|
||||
import org.springframework.scheduling.annotation.Async;
|
||||
import org.springframework.scheduling.annotation.AsyncResult;
|
|
@ -1,4 +1,4 @@
|
|||
package org.baeldung.async;
|
||||
package com.baeldung.async;
|
||||
|
||||
import java.lang.reflect.Method;
|
||||
|
|
@ -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")
|
|
@ -1,4 +1,4 @@
|
|||
package org.baeldung.scheduling;
|
||||
package com.baeldung.scheduling;
|
||||
|
||||
import org.springframework.scheduling.annotation.Scheduled;
|
||||
import org.springframework.stereotype.Component;
|
|
@ -1,4 +1,4 @@
|
|||
package org.baeldung.scheduling;
|
||||
package com.baeldung.scheduling;
|
||||
|
||||
public class SchedulingWithXmlConfig {
|
||||
|
|
@ -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 {
|
||||
|
|
@ -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 {
|
||||
|
||||
}
|
|
@ -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
|
|
@ -1,4 +1,4 @@
|
|||
package org.baeldung.springretry;
|
||||
package com.baeldung.springretry;
|
||||
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
|
@ -1,4 +1,4 @@
|
|||
package org.baeldung.springretry;
|
||||
package com.baeldung.springretry;
|
||||
|
||||
import java.sql.SQLException;
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
package org.baeldung.springretry;
|
||||
package com.baeldung.springretry;
|
||||
|
||||
import java.sql.SQLException;
|
||||
|
|
@ -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
|
|
@ -1,4 +1,4 @@
|
|||
package org.baeldung.taskscheduler;
|
||||
package com.baeldung.taskscheduler;
|
||||
|
||||
import java.util.Date;
|
||||
|
|
@ -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>
|
||||
|
||||
|
|
|
@ -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>
|
|
@ -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"
|
||||
|
|
|
@ -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;
|
|
@ -1,4 +1,4 @@
|
|||
package org.baeldung.async;
|
||||
package com.baeldung.async;
|
||||
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
|
@ -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;
|
|
@ -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
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
package org.baeldung.scheduling;
|
||||
package com.baeldung.scheduling;
|
||||
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
|
@ -1,4 +1,4 @@
|
|||
package org.baeldung.springretry;
|
||||
package com.baeldung.springretry;
|
||||
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
|
@ -1,4 +1,4 @@
|
|||
package org.baeldung.taskscheduler;
|
||||
package com.baeldung.taskscheduler;
|
||||
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
Loading…
Reference in New Issue