1
1
/*
2
- * Copyright 2002-2018 the original author or authors.
2
+ * Copyright 2002-2019 the original author or authors.
3
3
*
4
4
* Licensed under the Apache License, Version 2.0 (the "License");
5
5
* you may not use this file except in compliance with the License.
18
18
19
19
import org .springframework .beans .BeanUtils ;
20
20
import org .springframework .beans .factory .FactoryBean ;
21
+ import org .springframework .beans .factory .InitializingBean ;
21
22
import org .springframework .lang .Nullable ;
23
+ import org .springframework .transaction .TransactionSystemException ;
22
24
import org .springframework .transaction .jta .JtaTransactionManager ;
23
25
import org .springframework .util .ClassUtils ;
24
26
32
34
* @see org.springframework.transaction.jta.WebLogicJtaTransactionManager
33
35
* @see org.springframework.transaction.jta.WebSphereUowTransactionManager
34
36
*/
35
- public class JtaTransactionManagerFactoryBean implements FactoryBean <JtaTransactionManager > {
37
+ public class JtaTransactionManagerFactoryBean implements FactoryBean <JtaTransactionManager >, InitializingBean {
36
38
37
39
private static final String WEBLOGIC_JTA_TRANSACTION_MANAGER_CLASS_NAME =
38
40
"org.springframework.transaction.jta.WebLogicJtaTransactionManager" ;
@@ -55,7 +57,6 @@ public class JtaTransactionManagerFactoryBean implements FactoryBean<JtaTransact
55
57
}
56
58
57
59
58
- @ Nullable
59
60
private final JtaTransactionManager transactionManager ;
60
61
61
62
@@ -73,6 +74,11 @@ public JtaTransactionManagerFactoryBean() {
73
74
}
74
75
75
76
77
+ @ Override
78
+ public void afterPropertiesSet () throws TransactionSystemException {
79
+ this .transactionManager .afterPropertiesSet ();
80
+ }
81
+
76
82
@ Override
77
83
@ Nullable
78
84
public JtaTransactionManager getObject () {
@@ -81,7 +87,7 @@ public JtaTransactionManager getObject() {
81
87
82
88
@ Override
83
89
public Class <?> getObjectType () {
84
- return ( this .transactionManager != null ? this . transactionManager . getClass () : JtaTransactionManager . class );
90
+ return this .transactionManager . getClass ();
85
91
}
86
92
87
93
@ Override
0 commit comments