Skip to content

Commit 07db535

Browse files
committed
Polishing
1 parent 5cbe90b commit 07db535

File tree

1 file changed

+18
-20
lines changed

1 file changed

+18
-20
lines changed

spring-tx/src/main/java/org/springframework/transaction/jta/JtaTransactionManager.java

Lines changed: 18 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2014 the original author or authors.
2+
* Copyright 2002-2016 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.
@@ -81,29 +81,28 @@
8181
* Almost all Java EE servers expose it, but do so as extension to EE. There might be some
8282
* issues with compatibility, despite the TransactionManager interface being part of JTA.
8383
* As a consequence, Spring provides various vendor-specific PlatformTransactionManagers,
84-
* which are recommended to be used if appropriate: {@link WebLogicJtaTransactionManager},
85-
* {@link WebSphereUowTransactionManager} and {@link OC4JJtaTransactionManager}.
86-
* For all other Java EE servers, the standard JtaTransactionManager is sufficient.
84+
* which are recommended to be used if appropriate: {@link WebLogicJtaTransactionManager}
85+
* and {@link WebSphereUowTransactionManager}. For all other Java EE servers, the
86+
* standard JtaTransactionManager is sufficient.
8787
*
8888
* <p>This pure JtaTransactionManager class supports timeouts but not per-transaction
8989
* isolation levels. Custom subclasses may override the {@link #doJtaBegin} method for
90-
* specific JTA extensions in order to provide this functionality; Spring includes
91-
* corresponding {@link WebLogicJtaTransactionManager} and {@link OC4JJtaTransactionManager}
92-
* classes, for BEA's WebLogic Server and Oracle's OC4J, respectively. Such adapters
93-
* for specific Java EE transaction coordinators may also expose transaction names for
94-
* monitoring; with standard JTA, transaction names will simply be ignored.
90+
* specific JTA extensions in order to provide this functionality; Spring includes a
91+
* corresponding {@link WebLogicJtaTransactionManager} class for WebLogic Server. Such
92+
* adapters for specific Java EE transaction coordinators may also expose transaction
93+
* names for monitoring; with standard JTA, transaction names will simply be ignored.
9594
*
9695
* <p><b>Consider using Spring's {@code tx:jta-transaction-manager} configuration
9796
* element for automatically picking the appropriate JTA platform transaction manager
98-
* (automatically detecting WebLogic, WebSphere and OC4J).</b>
97+
* (automatically detecting WebLogic and WebSphere).</b>
9998
*
10099
* <p>JTA 1.1 adds the TransactionSynchronizationRegistry facility, as public Java EE 5
101100
* API in addition to the standard JTA UserTransaction handle. As of Spring 2.5, this
102101
* JtaTransactionManager autodetects the TransactionSynchronizationRegistry and uses
103102
* it for registering Spring-managed synchronizations when participating in an existing
104103
* JTA transaction (e.g. controlled by EJB CMT). If no TransactionSynchronizationRegistry
105-
* is available (or the JTA 1.1 API isn't available), then such synchronizations
106-
* will be registered via the (non-EE) JTA TransactionManager handle.
104+
* is available (or the JTA 1.1 API isn't available), then such synchronizations will be
105+
* registered via the (non-EE) JTA TransactionManager handle.
107106
*
108107
* <p>This class is serializable. However, active synchronizations do not survive serialization.
109108
*
@@ -346,7 +345,7 @@ public void setTransactionManager(TransactionManager transactionManager) {
346345
}
347346

348347
/**
349-
* Return the JTA TransactionManager that this transaction manager uses.
348+
* Return the JTA TransactionManager that this transaction manager uses, if any.
350349
*/
351350
public TransactionManager getTransactionManager() {
352351
return this.transactionManager;
@@ -449,7 +448,7 @@ protected void initUserTransactionAndTransactionManager() throws TransactionSyst
449448
}
450449

451450
// Autodetect UserTransaction object that implements TransactionManager,
452-
// and check fallback JNDI locations else.
451+
// and check fallback JNDI locations otherwise.
453452
if (this.transactionManager == null && this.autodetectTransactionManager) {
454453
this.transactionManager = findTransactionManager(this.userTransaction);
455454
}
@@ -738,8 +737,7 @@ protected Object findTransactionSynchronizationRegistry(UserTransaction ut, Tran
738737
}
739738
catch (NamingException ex) {
740739
if (logger.isDebugEnabled()) {
741-
logger.debug(
742-
"No JTA TransactionSynchronizationRegistry found at default JNDI location [" + jndiName + "]", ex);
740+
logger.debug("No JTA TransactionSynchronizationRegistry found at default JNDI location [" + jndiName + "]", ex);
743741
}
744742
}
745743
}
@@ -825,12 +823,12 @@ protected void doBegin(Object transaction, TransactionDefinition definition) {
825823
catch (NotSupportedException ex) {
826824
// assume nested transaction not supported
827825
throw new NestedTransactionNotSupportedException(
828-
"JTA implementation does not support nested transactions", ex);
826+
"JTA implementation does not support nested transactions", ex);
829827
}
830828
catch (UnsupportedOperationException ex) {
831829
// assume nested transaction not supported
832830
throw new NestedTransactionNotSupportedException(
833-
"JTA implementation does not support nested transactions", ex);
831+
"JTA implementation does not support nested transactions", ex);
834832
}
835833
catch (SystemException ex) {
836834
throw new CannotCreateTransactionException("JTA failure on begin", ex);
@@ -885,8 +883,8 @@ protected void applyIsolationLevel(JtaTransactionObject txObject, int isolationL
885883

886884
if (!this.allowCustomIsolationLevels && isolationLevel != TransactionDefinition.ISOLATION_DEFAULT) {
887885
throw new InvalidIsolationLevelException(
888-
"JtaTransactionManager does not support custom isolation levels by default - " +
889-
"switch 'allowCustomIsolationLevels' to 'true'");
886+
"JtaTransactionManager does not support custom isolation levels by default - " +
887+
"switch 'allowCustomIsolationLevels' to 'true'");
890888
}
891889
}
892890

0 commit comments

Comments
 (0)