refactoring

pull/6030/head
Nikita Koksharov 7 months ago
parent 553b467e32
commit e57723234d

@ -2,15 +2,14 @@ package org.redisson.spring.transaction;
import org.redisson.RedisDockerTest; import org.redisson.RedisDockerTest;
import org.redisson.api.RedissonReactiveClient; import org.redisson.api.RedissonReactiveClient;
import org.springframework.beans.factory.DisposableBean;
import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration; import org.springframework.context.annotation.Configuration;
import org.springframework.transaction.annotation.EnableTransactionManagement; import org.springframework.transaction.annotation.EnableTransactionManagement;
import javax.annotation.PreDestroy;
@Configuration @Configuration
@EnableTransactionManagement @EnableTransactionManagement
public class RedissonReactiveTransactionContextConfig { public class RedissonReactiveTransactionContextConfig implements DisposableBean {
@Bean @Bean
public ReactiveTransactionalBean2 transactionalBean2() { public ReactiveTransactionalBean2 transactionalBean2() {
@ -32,7 +31,6 @@ public class RedissonReactiveTransactionContextConfig {
return RedisDockerTest.createInstance().reactive(); return RedisDockerTest.createInstance().reactive();
} }
@PreDestroy
public void destroy() { public void destroy() {
redisson().shutdown(); redisson().shutdown();
} }

@ -2,15 +2,14 @@ package org.redisson.spring.transaction;
import org.redisson.RedisDockerTest; import org.redisson.RedisDockerTest;
import org.redisson.api.RedissonClient; import org.redisson.api.RedissonClient;
import org.springframework.beans.factory.DisposableBean;
import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration; import org.springframework.context.annotation.Configuration;
import org.springframework.transaction.annotation.EnableTransactionManagement; import org.springframework.transaction.annotation.EnableTransactionManagement;
import javax.annotation.PreDestroy;
@Configuration @Configuration
@EnableTransactionManagement @EnableTransactionManagement
public class RedissonTransactionContextConfig { public class RedissonTransactionContextConfig implements DisposableBean {
@Bean @Bean
public TransactionalBean2 transactionBean2() { public TransactionalBean2 transactionBean2() {
@ -32,7 +31,6 @@ public class RedissonTransactionContextConfig {
return RedisDockerTest.createInstance(); return RedisDockerTest.createInstance();
} }
@PreDestroy
public void destroy() { public void destroy() {
redisson().shutdown(); redisson().shutdown();
} }

Loading…
Cancel
Save