Skip to content

Commit d53be18

Browse files
committed
Deprecate support for Bitronix
Closes gh-20823
1 parent 6ccba24 commit d53be18

File tree

16 files changed

+44
-16
lines changed

16 files changed

+44
-16
lines changed

spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/transaction/jta/BitronixJtaConfiguration.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2012-2019 the original author or authors.
2+
* Copyright 2012-2020 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -51,7 +51,9 @@
5151
* @author Phillip Webb
5252
* @author Andy Wilkinson
5353
* @author Kazuki Shimizu
54+
* @deprecated since 2.3.0 as the Bitronix project is no longer being maintained
5455
*/
56+
@Deprecated
5557
@Configuration(proxyBeanMethods = false)
5658
@EnableConfigurationProperties(JtaProperties.class)
5759
@ConditionalOnClass({ JtaTransactionManager.class, BitronixContext.class })

spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/transaction/jta/JtaAutoConfiguration.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2012-2019 the original author or authors.
2+
* Copyright 2012-2020 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -35,6 +35,7 @@
3535
* @author Nishant Raut
3636
* @since 1.2.0
3737
*/
38+
@SuppressWarnings("deprecation")
3839
@Configuration(proxyBeanMethods = false)
3940
@ConditionalOnClass(javax.transaction.Transaction.class)
4041
@ConditionalOnProperty(prefix = "spring.jta", value = "enabled", matchIfMissing = true)

spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/transaction/jta/JtaAutoConfigurationTests.java

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2012-2019 the original author or authors.
2+
* Copyright 2012-2020 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -71,6 +71,7 @@
7171
* @author Kazuki Shimizu
7272
* @author Nishant Raut
7373
*/
74+
@SuppressWarnings("deprecation")
7475
class JtaAutoConfigurationTests {
7576

7677
private AnnotationConfigApplicationContext context;
@@ -115,6 +116,7 @@ void atomikosSanityCheck() {
115116
}
116117

117118
@Test
119+
@Deprecated
118120
void bitronixSanityCheck() {
119121
this.context = new AnnotationConfigApplicationContext(JtaProperties.class, BitronixJtaConfiguration.class);
120122
this.context.getBean(bitronix.tm.Configuration.class);
@@ -126,13 +128,15 @@ void bitronixSanityCheck() {
126128
}
127129

128130
@Test
131+
@Deprecated
129132
void defaultBitronixServerId() throws UnknownHostException {
130133
this.context = new AnnotationConfigApplicationContext(BitronixJtaConfiguration.class);
131134
String serverId = this.context.getBean(bitronix.tm.Configuration.class).getServerId();
132135
assertThat(serverId).isEqualTo(InetAddress.getLocalHost().getHostAddress());
133136
}
134137

135138
@Test
139+
@Deprecated
136140
void customBitronixServerId() {
137141
this.context = new AnnotationConfigApplicationContext();
138142
TestPropertyValues.of("spring.jta.transactionManagerId:custom").applyTo(this.context);
@@ -167,6 +171,7 @@ void atomikosConnectionFactoryPoolConfiguration() {
167171
}
168172

169173
@Test
174+
@Deprecated
170175
void bitronixConnectionFactoryPoolConfiguration() {
171176
this.context = new AnnotationConfigApplicationContext();
172177
TestPropertyValues.of("spring.jta.bitronix.connectionfactory.minPoolSize:5",
@@ -192,6 +197,7 @@ void atomikosDataSourcePoolConfiguration() {
192197
}
193198

194199
@Test
200+
@Deprecated
195201
void bitronixDataSourcePoolConfiguration() {
196202
this.context = new AnnotationConfigApplicationContext();
197203
TestPropertyValues
@@ -218,6 +224,7 @@ void atomikosCustomizeJtaTransactionManagerUsingProperties() {
218224
}
219225

220226
@Test
227+
@Deprecated
221228
void bitronixCustomizeJtaTransactionManagerUsingProperties() {
222229
this.context = new AnnotationConfigApplicationContext();
223230
TestPropertyValues

spring-boot-project/spring-boot-docs/src/docs/asciidoc/spring-boot-features.adoc

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5889,7 +5889,8 @@ When a `jndi-name` is set, it takes precedence over all other Session-related se
58895889

58905890
[[boot-features-jta]]
58915891
== Distributed Transactions with JTA
5892-
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.
5892+
Spring Boot supports distributed JTA transactions across multiple XA resources by using an https://www.atomikos.com/[Atomikos] embedded transaction manager.
5893+
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.
58935894
JTA transactions are also supported when deploying to a suitable Java EE Application Server.
58945895

58955896
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
59185919

59195920
[[boot-features-jta-bitronix]]
59205921
=== Using a Bitronix Transaction Manager
5921-
https://github.com/bitronix/btm[Bitronix] is a popular open-source JTA transaction manager implementation.
5922+
NOTE: As of Spring Boot 2.3, support for Bitronix has been deprecated and will be removed in a future release.
5923+
59225924
You can use the `spring-boot-starter-jta-bitronix` starter to add the appropriate Bitronix dependencies to your project.
59235925
As with Atomikos, Spring Boot automatically configures Bitronix and post-processes your beans to ensure that startup and shutdown ordering is correct.
59245926

@@ -5978,7 +5980,7 @@ The {spring-boot-module-code}/jms/XAConnectionFactoryWrapper.java[`XAConnectionF
59785980
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.
59795981
DataSource and JMS auto-configuration use JTA variants, provided you have a `JtaTransactionManager` bean and appropriate XA wrapper beans registered within your `ApplicationContext`.
59805982

5981-
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.
5983+
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.
59825984

59835985

59845986

spring-boot-project/spring-boot-starters/spring-boot-starter-jta-bitronix/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ plugins {
22
id "org.springframework.boot.starter"
33
}
44

5-
description = "Starter for JTA transactions using Bitronix"
5+
description = "Starter for JTA transactions using Bitronix. Deprecated since 2.3.0"
66

77
dependencies {
88
api(platform(project(":spring-boot-project:spring-boot-dependencies")))

spring-boot-project/spring-boot/src/main/java/org/springframework/boot/jta/bitronix/BitronixDependentBeanFactoryPostProcessor.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2012-2019 the original author or authors.
2+
* Copyright 2012-2020 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -32,7 +32,9 @@
3232
*
3333
* @author Phillip Webb
3434
* @since 1.2.0
35+
* @deprecated since 2.3.0 as the Bitronix project is no longer being maintained
3536
*/
37+
@Deprecated
3638
public class BitronixDependentBeanFactoryPostProcessor implements BeanFactoryPostProcessor, Ordered {
3739

3840
private static final String[] NO_BEANS = {};

spring-boot-project/spring-boot/src/main/java/org/springframework/boot/jta/bitronix/BitronixXAConnectionFactoryWrapper.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2012-2019 the original author or authors.
2+
* Copyright 2012-2020 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -27,7 +27,9 @@
2727
*
2828
* @author Phillip Webb
2929
* @since 1.2.0
30+
* @deprecated since 2.3.0 as the Bitronix project is no longer being maintained
3031
*/
32+
@Deprecated
3133
public class BitronixXAConnectionFactoryWrapper implements XAConnectionFactoryWrapper {
3234

3335
@Override

spring-boot-project/spring-boot/src/main/java/org/springframework/boot/jta/bitronix/BitronixXADataSourceWrapper.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2012-2019 the original author or authors.
2+
* Copyright 2012-2020 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -26,7 +26,9 @@
2626
*
2727
* @author Phillip Webb
2828
* @since 1.2.0
29+
* @deprecated since 2.3.0 as the Bitronix project is no longer being maintained
2930
*/
31+
@Deprecated
3032
public class BitronixXADataSourceWrapper implements XADataSourceWrapper {
3133

3234
@Override

spring-boot-project/spring-boot/src/main/java/org/springframework/boot/jta/bitronix/PoolingConnectionFactoryBean.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2012-2019 the original author or authors.
2+
* Copyright 2012-2020 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -41,7 +41,9 @@
4141
* @author Josh Long
4242
* @author Andy Wilkinson
4343
* @since 1.2.0
44+
* @deprecated since 2.3.0 as the Bitronix project is no longer being maintained
4445
*/
46+
@Deprecated
4547
@SuppressWarnings("serial")
4648
@ConfigurationProperties(prefix = "spring.jta.bitronix.connectionfactory")
4749
public class PoolingConnectionFactoryBean extends PoolingConnectionFactory

spring-boot-project/spring-boot/src/main/java/org/springframework/boot/jta/bitronix/PoolingDataSourceBean.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,9 @@
4242
* @author Josh Long
4343
* @author Andy Wilkinson
4444
* @since 1.2.0
45+
* @deprecated since 2.3.0 as the Bitronix project is no longer being maintained
4546
*/
47+
@Deprecated
4648
@SuppressWarnings("serial")
4749
@ConfigurationProperties(prefix = "spring.jta.bitronix.datasource")
4850
public class PoolingDataSourceBean extends PoolingDataSource implements BeanNameAware, InitializingBean {

spring-boot-project/spring-boot/src/main/java/org/springframework/boot/jta/bitronix/package-info.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2012-2019 the original author or authors.
2+
* Copyright 2012-2020 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -16,5 +16,6 @@
1616

1717
/**
1818
* Support classes for Bitronix JTA.
19+
* @deprecated since 2.3.0 as the Bitronix project is no longer being maintained
1920
*/
2021
package org.springframework.boot.jta.bitronix;

spring-boot-project/spring-boot/src/test/java/org/springframework/boot/jta/bitronix/BitronixDependentBeanFactoryPostProcessorTests.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2012-2019 the original author or authors.
2+
* Copyright 2012-2020 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -36,6 +36,7 @@
3636
*
3737
* @author Phillip Webb
3838
*/
39+
@Deprecated
3940
class BitronixDependentBeanFactoryPostProcessorTests {
4041

4142
private AnnotationConfigApplicationContext context;

spring-boot-project/spring-boot/src/test/java/org/springframework/boot/jta/bitronix/BitronixXAConnectionFactoryWrapperTests.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2012-2019 the original author or authors.
2+
* Copyright 2012-2020 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -29,6 +29,7 @@
2929
*
3030
* @author Phillip Webb
3131
*/
32+
@Deprecated
3233
class BitronixXAConnectionFactoryWrapperTests {
3334

3435
@Test

spring-boot-project/spring-boot/src/test/java/org/springframework/boot/jta/bitronix/BitronixXADataSourceWrapperTests.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2012-2019 the original author or authors.
2+
* Copyright 2012-2020 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -29,6 +29,7 @@
2929
*
3030
* @author Phillip Webb
3131
*/
32+
@Deprecated
3233
class BitronixXADataSourceWrapperTests {
3334

3435
@Test

spring-boot-project/spring-boot/src/test/java/org/springframework/boot/jta/bitronix/PoolingConnectionFactoryBeanTests.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2012-2019 the original author or authors.
2+
* Copyright 2012-2020 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -29,6 +29,7 @@
2929
*
3030
* @author Phillip Webb
3131
*/
32+
@Deprecated
3233
class PoolingConnectionFactoryBeanTests {
3334

3435
@SuppressWarnings("serial")

spring-boot-project/spring-boot/src/test/java/org/springframework/boot/jta/bitronix/PoolingDataSourceBeanTests.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@
3636
*
3737
* @author Phillip Webb
3838
*/
39+
@Deprecated
3940
class PoolingDataSourceBeanTests {
4041

4142
private PoolingDataSourceBean bean = new PoolingDataSourceBean();

0 commit comments

Comments
 (0)