JtaTransactionManagerFactoryBean fully initializes its JTM instance
Closes gh-22605
This commit is contained in:
parent
271445b89e
commit
d6c1a65737
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
* Copyright 2002-2018 the original author or authors.
|
* Copyright 2002-2019 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.
|
||||||
|
@ -18,7 +18,9 @@ package org.springframework.transaction.config;
|
||||||
|
|
||||||
import org.springframework.beans.BeanUtils;
|
import org.springframework.beans.BeanUtils;
|
||||||
import org.springframework.beans.factory.FactoryBean;
|
import org.springframework.beans.factory.FactoryBean;
|
||||||
|
import org.springframework.beans.factory.InitializingBean;
|
||||||
import org.springframework.lang.Nullable;
|
import org.springframework.lang.Nullable;
|
||||||
|
import org.springframework.transaction.TransactionSystemException;
|
||||||
import org.springframework.transaction.jta.JtaTransactionManager;
|
import org.springframework.transaction.jta.JtaTransactionManager;
|
||||||
import org.springframework.util.ClassUtils;
|
import org.springframework.util.ClassUtils;
|
||||||
|
|
||||||
|
@ -32,7 +34,7 @@ import org.springframework.util.ClassUtils;
|
||||||
* @see org.springframework.transaction.jta.WebLogicJtaTransactionManager
|
* @see org.springframework.transaction.jta.WebLogicJtaTransactionManager
|
||||||
* @see org.springframework.transaction.jta.WebSphereUowTransactionManager
|
* @see org.springframework.transaction.jta.WebSphereUowTransactionManager
|
||||||
*/
|
*/
|
||||||
public class JtaTransactionManagerFactoryBean implements FactoryBean<JtaTransactionManager> {
|
public class JtaTransactionManagerFactoryBean implements FactoryBean<JtaTransactionManager>, InitializingBean {
|
||||||
|
|
||||||
private static final String WEBLOGIC_JTA_TRANSACTION_MANAGER_CLASS_NAME =
|
private static final String WEBLOGIC_JTA_TRANSACTION_MANAGER_CLASS_NAME =
|
||||||
"org.springframework.transaction.jta.WebLogicJtaTransactionManager";
|
"org.springframework.transaction.jta.WebLogicJtaTransactionManager";
|
||||||
|
@ -55,7 +57,6 @@ public class JtaTransactionManagerFactoryBean implements FactoryBean<JtaTransact
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@Nullable
|
|
||||||
private final JtaTransactionManager transactionManager;
|
private final JtaTransactionManager transactionManager;
|
||||||
|
|
||||||
|
|
||||||
|
@ -73,6 +74,11 @@ public class JtaTransactionManagerFactoryBean implements FactoryBean<JtaTransact
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void afterPropertiesSet() throws TransactionSystemException {
|
||||||
|
this.transactionManager.afterPropertiesSet();
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@Nullable
|
@Nullable
|
||||||
public JtaTransactionManager getObject() {
|
public JtaTransactionManager getObject() {
|
||||||
|
@ -81,7 +87,7 @@ public class JtaTransactionManagerFactoryBean implements FactoryBean<JtaTransact
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Class<?> getObjectType() {
|
public Class<?> getObjectType() {
|
||||||
return (this.transactionManager != null ? this.transactionManager.getClass() : JtaTransactionManager.class);
|
return this.transactionManager.getClass();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
Loading…
Reference in New Issue