polishing
This commit is contained in:
parent
d34c4a2cf0
commit
d34953e933
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright 2002-2005 the original author or authors.
|
||||
* Copyright 2002-2009 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.
|
||||
|
|
@ -19,15 +19,13 @@ package org.springframework.transaction.annotation;
|
|||
import org.springframework.transaction.TransactionDefinition;
|
||||
|
||||
/**
|
||||
* Enumeration that represents transaction isolation levels
|
||||
* for use with the JDK 1.5+ transaction annotation, corresponding
|
||||
* to the TransactionDefinition interface.
|
||||
* Enumeration that represents transaction isolation levels for use
|
||||
* with the {@link Transactional} annotation, corresponding to the
|
||||
* {@link TransactionDefinition} interface.
|
||||
*
|
||||
* @author Colin Sampaleanu
|
||||
* @author Juergen Hoeller
|
||||
* @since 1.2
|
||||
* @see org.springframework.transaction.annotation.Transactional
|
||||
* @see org.springframework.transaction.TransactionDefinition
|
||||
*/
|
||||
public enum Isolation {
|
||||
|
||||
|
|
@ -85,6 +83,6 @@ public enum Isolation {
|
|||
|
||||
Isolation(int value) { this.value = value; }
|
||||
|
||||
public int value() { return value; }
|
||||
public int value() { return this.value; }
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright 2002-2005 the original author or authors.
|
||||
* Copyright 2002-2009 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.
|
||||
|
|
@ -19,15 +19,13 @@ package org.springframework.transaction.annotation;
|
|||
import org.springframework.transaction.TransactionDefinition;
|
||||
|
||||
/**
|
||||
* Enumeration that represents transaction propagation behaviors
|
||||
* for use with the JDK 1.5+ transaction annotation, corresponding
|
||||
* to the TransactionDefinition interface.
|
||||
* Enumeration that represents transaction propagation behaviors for use
|
||||
* with the {@link Transactional} annotation, corresponding to the
|
||||
* {@link TransactionDefinition} interface.
|
||||
*
|
||||
* @author Colin Sampaleanu
|
||||
* @author Juergen Hoeller
|
||||
* @since 1.2
|
||||
* @see org.springframework.transaction.annotation.Transactional
|
||||
* @see org.springframework.transaction.TransactionDefinition
|
||||
*/
|
||||
public enum Propagation {
|
||||
|
||||
|
|
@ -43,7 +41,7 @@ public enum Propagation {
|
|||
* Analogous to EJB transaction attribute of the same name.
|
||||
* <p>Note: For transaction managers with transaction synchronization,
|
||||
* PROPAGATION_SUPPORTS is slightly different from no transaction at all,
|
||||
* as it defines a transaction scopp that synchronization will apply for.
|
||||
* as it defines a transaction scope that synchronization will apply for.
|
||||
* As a consequence, the same resources (JDBC Connection, Hibernate Session, etc)
|
||||
* will be shared for the entire specified scope. Note that this depends on
|
||||
* the actual synchronization configuration of the transaction manager.
|
||||
|
|
@ -102,6 +100,6 @@ public enum Propagation {
|
|||
|
||||
Propagation(int value) { this.value = value; }
|
||||
|
||||
public int value() { return value; }
|
||||
public int value() { return this.value; }
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright 2002-2008 the original author or authors.
|
||||
* Copyright 2002-2009 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.
|
||||
|
|
@ -38,8 +38,7 @@ import org.springframework.transaction.UnexpectedRollbackException;
|
|||
/**
|
||||
* Abstract base class that implements Spring's standard transaction workflow,
|
||||
* serving as basis for concrete platform transaction managers like
|
||||
* {@link org.springframework.transaction.jta.JtaTransactionManager} and
|
||||
* {@link org.springframework.jdbc.datasource.DataSourceTransactionManager}.
|
||||
* {@link org.springframework.transaction.jta.JtaTransactionManager}.
|
||||
*
|
||||
* <p>This base class provides the following workflow handling:
|
||||
* <ul>
|
||||
|
|
@ -78,8 +77,6 @@ import org.springframework.transaction.UnexpectedRollbackException;
|
|||
* @see #setTransactionSynchronization
|
||||
* @see TransactionSynchronizationManager
|
||||
* @see org.springframework.transaction.jta.JtaTransactionManager
|
||||
* @see org.springframework.jdbc.datasource.DataSourceTransactionManager
|
||||
* @see org.springframework.orm.hibernate3.HibernateTransactionManager
|
||||
*/
|
||||
public abstract class AbstractPlatformTransactionManager implements PlatformTransactionManager, Serializable {
|
||||
|
||||
|
|
@ -260,7 +257,6 @@ public abstract class AbstractPlatformTransactionManager implements PlatformTran
|
|||
* only work when nested transaction support is available. This is the case
|
||||
* with DataSourceTransactionManager, but not with JtaTransactionManager.
|
||||
* @see #setNestedTransactionAllowed
|
||||
* @see org.springframework.jdbc.datasource.DataSourceTransactionManager
|
||||
* @see org.springframework.transaction.jta.JtaTransactionManager
|
||||
*/
|
||||
public final void setGlobalRollbackOnParticipationFailure(boolean globalRollbackOnParticipationFailure) {
|
||||
|
|
@ -543,7 +539,7 @@ public abstract class AbstractPlatformTransactionManager implements PlatformTran
|
|||
*/
|
||||
protected final SuspendedResourcesHolder suspend(Object transaction) throws TransactionException {
|
||||
if (TransactionSynchronizationManager.isSynchronizationActive()) {
|
||||
List suspendedSynchronizations = doSuspendSynchronization();
|
||||
List<TransactionSynchronization> suspendedSynchronizations = doSuspendSynchronization();
|
||||
try {
|
||||
Object suspendedResources = null;
|
||||
if (transaction != null) {
|
||||
|
|
@ -600,7 +596,7 @@ public abstract class AbstractPlatformTransactionManager implements PlatformTran
|
|||
if (suspendedResources != null) {
|
||||
doResume(transaction, suspendedResources);
|
||||
}
|
||||
List suspendedSynchronizations = resourcesHolder.suspendedSynchronizations;
|
||||
List<TransactionSynchronization> suspendedSynchronizations = resourcesHolder.suspendedSynchronizations;
|
||||
if (suspendedSynchronizations != null) {
|
||||
TransactionSynchronizationManager.setActualTransactionActive(resourcesHolder.wasActive);
|
||||
TransactionSynchronizationManager.setCurrentTransactionIsolationLevel(resourcesHolder.isolationLevel);
|
||||
|
|
@ -938,7 +934,7 @@ public abstract class AbstractPlatformTransactionManager implements PlatformTran
|
|||
*/
|
||||
private void triggerAfterCompletion(DefaultTransactionStatus status, int completionStatus) {
|
||||
if (status.isNewSynchronization()) {
|
||||
List synchronizations = TransactionSynchronizationManager.getSynchronizations();
|
||||
List<TransactionSynchronization> synchronizations = TransactionSynchronizationManager.getSynchronizations();
|
||||
if (!status.hasTransaction() || status.isNewTransaction()) {
|
||||
if (status.isDebug()) {
|
||||
logger.trace("Triggering afterCompletion synchronization");
|
||||
|
|
@ -969,7 +965,7 @@ public abstract class AbstractPlatformTransactionManager implements PlatformTran
|
|||
* @see TransactionSynchronization#STATUS_ROLLED_BACK
|
||||
* @see TransactionSynchronization#STATUS_UNKNOWN
|
||||
*/
|
||||
protected final void invokeAfterCompletion(List synchronizations, int completionStatus) {
|
||||
protected final void invokeAfterCompletion(List<TransactionSynchronization> synchronizations, int completionStatus) {
|
||||
TransactionSynchronizationUtils.invokeAfterCompletion(synchronizations, completionStatus);
|
||||
}
|
||||
|
||||
|
|
@ -1217,8 +1213,8 @@ public abstract class AbstractPlatformTransactionManager implements PlatformTran
|
|||
* @see TransactionSynchronization#afterCompletion(int)
|
||||
* @see TransactionSynchronization#STATUS_UNKNOWN
|
||||
*/
|
||||
protected void registerAfterCompletionWithExistingTransaction(Object transaction, List synchronizations)
|
||||
throws TransactionException {
|
||||
protected void registerAfterCompletionWithExistingTransaction(
|
||||
Object transaction, List<TransactionSynchronization> synchronizations) throws TransactionException {
|
||||
|
||||
logger.debug("Cannot register Spring after-completion synchronization with existing transaction - " +
|
||||
"processing Spring after-completion callbacks immediately, with outcome status 'unknown'");
|
||||
|
|
@ -1256,7 +1252,7 @@ public abstract class AbstractPlatformTransactionManager implements PlatformTran
|
|||
protected static class SuspendedResourcesHolder {
|
||||
|
||||
private final Object suspendedResources;
|
||||
private List suspendedSynchronizations;
|
||||
private List<TransactionSynchronization> suspendedSynchronizations;
|
||||
private String name;
|
||||
private boolean readOnly;
|
||||
private Integer isolationLevel;
|
||||
|
|
@ -1267,7 +1263,7 @@ public abstract class AbstractPlatformTransactionManager implements PlatformTran
|
|||
}
|
||||
|
||||
private SuspendedResourcesHolder(
|
||||
Object suspendedResources, List suspendedSynchronizations,
|
||||
Object suspendedResources, List<TransactionSynchronization> suspendedSynchronizations,
|
||||
String name, boolean readOnly, Integer isolationLevel, boolean wasActive) {
|
||||
this.suspendedResources = suspendedResources;
|
||||
this.suspendedSynchronizations = suspendedSynchronizations;
|
||||
|
|
|
|||
Loading…
Reference in New Issue