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");
* 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 Andy Wilkinson
* @author Kazuki Shimizu
* @deprecated since 2.3.0 as the Bitronix project is no longer being maintained
*/
@Deprecated
@Configuration(proxyBeanMethods = false)
@EnableConfigurationProperties(JtaProperties.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");
* 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
* @since 1.2.0
*/
@SuppressWarnings("deprecation")
@Configuration(proxyBeanMethods = false)
@ConditionalOnClass(javax.transaction.Transaction.class)
@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");
* 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 Nishant Raut
*/
@SuppressWarnings("deprecation")
class JtaAutoConfigurationTests {
private AnnotationConfigApplicationContext context;
@ -115,6 +116,7 @@ class JtaAutoConfigurationTests {
}
@Test
@Deprecated
void bitronixSanityCheck() {
this.context = new AnnotationConfigApplicationContext(JtaProperties.class, BitronixJtaConfiguration.class);
this.context.getBean(bitronix.tm.Configuration.class);
@ -126,6 +128,7 @@ class JtaAutoConfigurationTests {
}
@Test
@Deprecated
void defaultBitronixServerId() throws UnknownHostException {
this.context = new AnnotationConfigApplicationContext(BitronixJtaConfiguration.class);
String serverId = this.context.getBean(bitronix.tm.Configuration.class).getServerId();
@ -133,6 +136,7 @@ class JtaAutoConfigurationTests {
}
@Test
@Deprecated
void customBitronixServerId() {
this.context = new AnnotationConfigApplicationContext();
TestPropertyValues.of("spring.jta.transactionManagerId:custom").applyTo(this.context);
@ -167,6 +171,7 @@ class JtaAutoConfigurationTests {
}
@Test
@Deprecated
void bitronixConnectionFactoryPoolConfiguration() {
this.context = new AnnotationConfigApplicationContext();
TestPropertyValues.of("spring.jta.bitronix.connectionfactory.minPoolSize:5",
@ -192,6 +197,7 @@ class JtaAutoConfigurationTests {
}
@Test
@Deprecated
void bitronixDataSourcePoolConfiguration() {
this.context = new AnnotationConfigApplicationContext();
TestPropertyValues
@ -218,6 +224,7 @@ class JtaAutoConfigurationTests {
}
@Test
@Deprecated
void bitronixCustomizeJtaTransactionManagerUsingProperties() {
this.context = new AnnotationConfigApplicationContext();
TestPropertyValues

@ -5889,7 +5889,8 @@ When a `jndi-name` is set, it takes precedence over all other Session-related se
[[boot-features-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.
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]]
=== 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.
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.
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"
}
description = "Starter for JTA transactions using Bitronix"
description = "Starter for JTA transactions using Bitronix. Deprecated since 2.3.0"
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");
* you may not use this file except in compliance with the License.
@ -32,7 +32,9 @@ import org.springframework.core.Ordered;
*
* @author Phillip Webb
* @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 {
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");
* 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
* @since 1.2.0
* @deprecated since 2.3.0 as the Bitronix project is no longer being maintained
*/
@Deprecated
public class BitronixXAConnectionFactoryWrapper implements XAConnectionFactoryWrapper {
@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");
* 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
* @since 1.2.0
* @deprecated since 2.3.0 as the Bitronix project is no longer being maintained
*/
@Deprecated
public class BitronixXADataSourceWrapper implements XADataSourceWrapper {
@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");
* 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 Andy Wilkinson
* @since 1.2.0
* @deprecated since 2.3.0 as the Bitronix project is no longer being maintained
*/
@Deprecated
@SuppressWarnings("serial")
@ConfigurationProperties(prefix = "spring.jta.bitronix.connectionfactory")
public class PoolingConnectionFactoryBean extends PoolingConnectionFactory

@ -42,7 +42,9 @@ import org.springframework.util.StringUtils;
* @author Josh Long
* @author Andy Wilkinson
* @since 1.2.0
* @deprecated since 2.3.0 as the Bitronix project is no longer being maintained
*/
@Deprecated
@SuppressWarnings("serial")
@ConfigurationProperties(prefix = "spring.jta.bitronix.datasource")
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");
* you may not use this file except in compliance with the License.
@ -16,5 +16,6 @@
/**
* 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;

@ -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");
* 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
*/
@Deprecated
class BitronixDependentBeanFactoryPostProcessorTests {
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");
* 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
*/
@Deprecated
class BitronixXAConnectionFactoryWrapperTests {
@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");
* 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
*/
@Deprecated
class BitronixXADataSourceWrapperTests {
@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");
* 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
*/
@Deprecated
class PoolingConnectionFactoryBeanTests {
@SuppressWarnings("serial")

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

Loading…
Cancel
Save