Deprecate support for Bitronix

Closes gh-20823
pull/21110/head
Andy Wilkinson 5 years ago
parent 6ccba24494
commit d53be18582

@ -1,5 +1,5 @@
/* /*
* Copyright 2012-2019 the original author or authors. * Copyright 2012-2020 the original author or authors.
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
@ -51,7 +51,9 @@ import org.springframework.util.StringUtils;
* @author Phillip Webb * @author Phillip Webb
* @author Andy Wilkinson * @author Andy Wilkinson
* @author Kazuki Shimizu * @author Kazuki Shimizu
* @deprecated since 2.3.0 as the Bitronix project is no longer being maintained
*/ */
@Deprecated
@Configuration(proxyBeanMethods = false) @Configuration(proxyBeanMethods = false)
@EnableConfigurationProperties(JtaProperties.class) @EnableConfigurationProperties(JtaProperties.class)
@ConditionalOnClass({ JtaTransactionManager.class, BitronixContext.class }) @ConditionalOnClass({ JtaTransactionManager.class, BitronixContext.class })

@ -1,5 +1,5 @@
/* /*
* Copyright 2012-2019 the original author or authors. * Copyright 2012-2020 the original author or authors.
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
@ -35,6 +35,7 @@ import org.springframework.context.annotation.Import;
* @author Nishant Raut * @author Nishant Raut
* @since 1.2.0 * @since 1.2.0
*/ */
@SuppressWarnings("deprecation")
@Configuration(proxyBeanMethods = false) @Configuration(proxyBeanMethods = false)
@ConditionalOnClass(javax.transaction.Transaction.class) @ConditionalOnClass(javax.transaction.Transaction.class)
@ConditionalOnProperty(prefix = "spring.jta", value = "enabled", matchIfMissing = true) @ConditionalOnProperty(prefix = "spring.jta", value = "enabled", matchIfMissing = true)

@ -1,5 +1,5 @@
/* /*
* Copyright 2012-2019 the original author or authors. * Copyright 2012-2020 the original author or authors.
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
@ -71,6 +71,7 @@ import static org.mockito.Mockito.mock;
* @author Kazuki Shimizu * @author Kazuki Shimizu
* @author Nishant Raut * @author Nishant Raut
*/ */
@SuppressWarnings("deprecation")
class JtaAutoConfigurationTests { class JtaAutoConfigurationTests {
private AnnotationConfigApplicationContext context; private AnnotationConfigApplicationContext context;
@ -115,6 +116,7 @@ class JtaAutoConfigurationTests {
} }
@Test @Test
@Deprecated
void bitronixSanityCheck() { void bitronixSanityCheck() {
this.context = new AnnotationConfigApplicationContext(JtaProperties.class, BitronixJtaConfiguration.class); this.context = new AnnotationConfigApplicationContext(JtaProperties.class, BitronixJtaConfiguration.class);
this.context.getBean(bitronix.tm.Configuration.class); this.context.getBean(bitronix.tm.Configuration.class);
@ -126,6 +128,7 @@ class JtaAutoConfigurationTests {
} }
@Test @Test
@Deprecated
void defaultBitronixServerId() throws UnknownHostException { void defaultBitronixServerId() throws UnknownHostException {
this.context = new AnnotationConfigApplicationContext(BitronixJtaConfiguration.class); this.context = new AnnotationConfigApplicationContext(BitronixJtaConfiguration.class);
String serverId = this.context.getBean(bitronix.tm.Configuration.class).getServerId(); String serverId = this.context.getBean(bitronix.tm.Configuration.class).getServerId();
@ -133,6 +136,7 @@ class JtaAutoConfigurationTests {
} }
@Test @Test
@Deprecated
void customBitronixServerId() { void customBitronixServerId() {
this.context = new AnnotationConfigApplicationContext(); this.context = new AnnotationConfigApplicationContext();
TestPropertyValues.of("spring.jta.transactionManagerId:custom").applyTo(this.context); TestPropertyValues.of("spring.jta.transactionManagerId:custom").applyTo(this.context);
@ -167,6 +171,7 @@ class JtaAutoConfigurationTests {
} }
@Test @Test
@Deprecated
void bitronixConnectionFactoryPoolConfiguration() { void bitronixConnectionFactoryPoolConfiguration() {
this.context = new AnnotationConfigApplicationContext(); this.context = new AnnotationConfigApplicationContext();
TestPropertyValues.of("spring.jta.bitronix.connectionfactory.minPoolSize:5", TestPropertyValues.of("spring.jta.bitronix.connectionfactory.minPoolSize:5",
@ -192,6 +197,7 @@ class JtaAutoConfigurationTests {
} }
@Test @Test
@Deprecated
void bitronixDataSourcePoolConfiguration() { void bitronixDataSourcePoolConfiguration() {
this.context = new AnnotationConfigApplicationContext(); this.context = new AnnotationConfigApplicationContext();
TestPropertyValues TestPropertyValues
@ -218,6 +224,7 @@ class JtaAutoConfigurationTests {
} }
@Test @Test
@Deprecated
void bitronixCustomizeJtaTransactionManagerUsingProperties() { void bitronixCustomizeJtaTransactionManagerUsingProperties() {
this.context = new AnnotationConfigApplicationContext(); this.context = new AnnotationConfigApplicationContext();
TestPropertyValues TestPropertyValues

@ -5889,7 +5889,8 @@ When a `jndi-name` is set, it takes precedence over all other Session-related se
[[boot-features-jta]] [[boot-features-jta]]
== Distributed Transactions with JTA == Distributed Transactions with JTA
Spring Boot supports distributed JTA transactions across multiple XA resources by using either an https://www.atomikos.com/[Atomikos] or https://github.com/bitronix/btm[Bitronix] embedded transaction manager. Spring Boot supports distributed JTA transactions across multiple XA resources by using an https://www.atomikos.com/[Atomikos] embedded transaction manager.
Deprecated support for using a https://github.com/bitronix/btm[Bitronix] embedded transaction manager is also provided but it will be removed in a future release.
JTA transactions are also supported when deploying to a suitable Java EE Application Server. JTA transactions are also supported when deploying to a suitable Java EE Application Server.
When a JTA environment is detected, Spring's `JtaTransactionManager` is used to manage transactions. When a JTA environment is detected, Spring's `JtaTransactionManager` is used to manage transactions.
@ -5918,7 +5919,8 @@ To ensure uniqueness in production, you should configure the configprop:spring.j
[[boot-features-jta-bitronix]] [[boot-features-jta-bitronix]]
=== Using a Bitronix Transaction Manager === Using a Bitronix Transaction Manager
https://github.com/bitronix/btm[Bitronix] is a popular open-source JTA transaction manager implementation. NOTE: As of Spring Boot 2.3, support for Bitronix has been deprecated and will be removed in a future release.
You can use the `spring-boot-starter-jta-bitronix` starter to add the appropriate Bitronix dependencies to your project. You can use the `spring-boot-starter-jta-bitronix` starter to add the appropriate Bitronix dependencies to your project.
As with Atomikos, Spring Boot automatically configures Bitronix and post-processes your beans to ensure that startup and shutdown ordering is correct. As with Atomikos, Spring Boot automatically configures Bitronix and post-processes your beans to ensure that startup and shutdown ordering is correct.
@ -5978,7 +5980,7 @@ The {spring-boot-module-code}/jms/XAConnectionFactoryWrapper.java[`XAConnectionF
The interfaces are responsible for wrapping `XAConnectionFactory` and `XADataSource` beans and exposing them as regular `ConnectionFactory` and `DataSource` beans, which transparently enroll in the distributed transaction. The interfaces are responsible for wrapping `XAConnectionFactory` and `XADataSource` beans and exposing them as regular `ConnectionFactory` and `DataSource` beans, which transparently enroll in the distributed transaction.
DataSource and JMS auto-configuration use JTA variants, provided you have a `JtaTransactionManager` bean and appropriate XA wrapper beans registered within your `ApplicationContext`. DataSource and JMS auto-configuration use JTA variants, provided you have a `JtaTransactionManager` bean and appropriate XA wrapper beans registered within your `ApplicationContext`.
The {spring-boot-module-code}/jta/bitronix/BitronixXAConnectionFactoryWrapper.java[BitronixXAConnectionFactoryWrapper] and {spring-boot-module-code}/jta/bitronix/BitronixXADataSourceWrapper.java[BitronixXADataSourceWrapper] provide good examples of how to write XA wrappers. The {spring-boot-module-code}/jta/atomikos/AtomikosXAConnectionFactoryWrapper.java[AtomikosXAConnectionFactoryWrapper] and {spring-boot-module-code}/jta/atomikos/AtomikosXADataSourceWrapper.java[AtomikosXADataSourceWrapper] provide good examples of how to write XA wrappers.

@ -2,7 +2,7 @@ plugins {
id "org.springframework.boot.starter" id "org.springframework.boot.starter"
} }
description = "Starter for JTA transactions using Bitronix" description = "Starter for JTA transactions using Bitronix. Deprecated since 2.3.0"
dependencies { dependencies {
api(platform(project(":spring-boot-project:spring-boot-dependencies"))) api(platform(project(":spring-boot-project:spring-boot-dependencies")))

@ -1,5 +1,5 @@
/* /*
* Copyright 2012-2019 the original author or authors. * Copyright 2012-2020 the original author or authors.
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
@ -32,7 +32,9 @@ import org.springframework.core.Ordered;
* *
* @author Phillip Webb * @author Phillip Webb
* @since 1.2.0 * @since 1.2.0
* @deprecated since 2.3.0 as the Bitronix project is no longer being maintained
*/ */
@Deprecated
public class BitronixDependentBeanFactoryPostProcessor implements BeanFactoryPostProcessor, Ordered { public class BitronixDependentBeanFactoryPostProcessor implements BeanFactoryPostProcessor, Ordered {
private static final String[] NO_BEANS = {}; private static final String[] NO_BEANS = {};

@ -1,5 +1,5 @@
/* /*
* Copyright 2012-2019 the original author or authors. * Copyright 2012-2020 the original author or authors.
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
@ -27,7 +27,9 @@ import org.springframework.boot.jms.XAConnectionFactoryWrapper;
* *
* @author Phillip Webb * @author Phillip Webb
* @since 1.2.0 * @since 1.2.0
* @deprecated since 2.3.0 as the Bitronix project is no longer being maintained
*/ */
@Deprecated
public class BitronixXAConnectionFactoryWrapper implements XAConnectionFactoryWrapper { public class BitronixXAConnectionFactoryWrapper implements XAConnectionFactoryWrapper {
@Override @Override

@ -1,5 +1,5 @@
/* /*
* Copyright 2012-2019 the original author or authors. * Copyright 2012-2020 the original author or authors.
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
@ -26,7 +26,9 @@ import org.springframework.boot.jdbc.XADataSourceWrapper;
* *
* @author Phillip Webb * @author Phillip Webb
* @since 1.2.0 * @since 1.2.0
* @deprecated since 2.3.0 as the Bitronix project is no longer being maintained
*/ */
@Deprecated
public class BitronixXADataSourceWrapper implements XADataSourceWrapper { public class BitronixXADataSourceWrapper implements XADataSourceWrapper {
@Override @Override

@ -1,5 +1,5 @@
/* /*
* Copyright 2012-2019 the original author or authors. * Copyright 2012-2020 the original author or authors.
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
@ -41,7 +41,9 @@ import org.springframework.util.StringUtils;
* @author Josh Long * @author Josh Long
* @author Andy Wilkinson * @author Andy Wilkinson
* @since 1.2.0 * @since 1.2.0
* @deprecated since 2.3.0 as the Bitronix project is no longer being maintained
*/ */
@Deprecated
@SuppressWarnings("serial") @SuppressWarnings("serial")
@ConfigurationProperties(prefix = "spring.jta.bitronix.connectionfactory") @ConfigurationProperties(prefix = "spring.jta.bitronix.connectionfactory")
public class PoolingConnectionFactoryBean extends PoolingConnectionFactory public class PoolingConnectionFactoryBean extends PoolingConnectionFactory

@ -42,7 +42,9 @@ import org.springframework.util.StringUtils;
* @author Josh Long * @author Josh Long
* @author Andy Wilkinson * @author Andy Wilkinson
* @since 1.2.0 * @since 1.2.0
* @deprecated since 2.3.0 as the Bitronix project is no longer being maintained
*/ */
@Deprecated
@SuppressWarnings("serial") @SuppressWarnings("serial")
@ConfigurationProperties(prefix = "spring.jta.bitronix.datasource") @ConfigurationProperties(prefix = "spring.jta.bitronix.datasource")
public class PoolingDataSourceBean extends PoolingDataSource implements BeanNameAware, InitializingBean { public class PoolingDataSourceBean extends PoolingDataSource implements BeanNameAware, InitializingBean {

@ -1,5 +1,5 @@
/* /*
* Copyright 2012-2019 the original author or authors. * Copyright 2012-2020 the original author or authors.
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
@ -16,5 +16,6 @@
/** /**
* Support classes for Bitronix JTA. * Support classes for Bitronix JTA.
* @deprecated since 2.3.0 as the Bitronix project is no longer being maintained
*/ */
package org.springframework.boot.jta.bitronix; package org.springframework.boot.jta.bitronix;

@ -1,5 +1,5 @@
/* /*
* Copyright 2012-2019 the original author or authors. * Copyright 2012-2020 the original author or authors.
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
@ -36,6 +36,7 @@ import static org.mockito.Mockito.verify;
* *
* @author Phillip Webb * @author Phillip Webb
*/ */
@Deprecated
class BitronixDependentBeanFactoryPostProcessorTests { class BitronixDependentBeanFactoryPostProcessorTests {
private AnnotationConfigApplicationContext context; private AnnotationConfigApplicationContext context;

@ -1,5 +1,5 @@
/* /*
* Copyright 2012-2019 the original author or authors. * Copyright 2012-2020 the original author or authors.
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
@ -29,6 +29,7 @@ import static org.mockito.Mockito.mock;
* *
* @author Phillip Webb * @author Phillip Webb
*/ */
@Deprecated
class BitronixXAConnectionFactoryWrapperTests { class BitronixXAConnectionFactoryWrapperTests {
@Test @Test

@ -1,5 +1,5 @@
/* /*
* Copyright 2012-2019 the original author or authors. * Copyright 2012-2020 the original author or authors.
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
@ -29,6 +29,7 @@ import static org.mockito.Mockito.mock;
* *
* @author Phillip Webb * @author Phillip Webb
*/ */
@Deprecated
class BitronixXADataSourceWrapperTests { class BitronixXADataSourceWrapperTests {
@Test @Test

@ -1,5 +1,5 @@
/* /*
* Copyright 2012-2019 the original author or authors. * Copyright 2012-2020 the original author or authors.
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
@ -29,6 +29,7 @@ import static org.mockito.Mockito.verify;
* *
* @author Phillip Webb * @author Phillip Webb
*/ */
@Deprecated
class PoolingConnectionFactoryBeanTests { class PoolingConnectionFactoryBeanTests {
@SuppressWarnings("serial") @SuppressWarnings("serial")

@ -36,6 +36,7 @@ import static org.mockito.Mockito.verify;
* *
* @author Phillip Webb * @author Phillip Webb
*/ */
@Deprecated
class PoolingDataSourceBeanTests { class PoolingDataSourceBeanTests {
private PoolingDataSourceBean bean = new PoolingDataSourceBean(); private PoolingDataSourceBean bean = new PoolingDataSourceBean();

Loading…
Cancel
Save