Polishing
This commit is contained in:
@@ -113,7 +113,6 @@ public abstract class Assume {
|
|||||||
/**
|
/**
|
||||||
* @since 4.2
|
* @since 4.2
|
||||||
*/
|
*/
|
||||||
@FunctionalInterface
|
|
||||||
public interface Executable {
|
public interface Executable {
|
||||||
|
|
||||||
void execute() throws Exception;
|
void execute() throws Exception;
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright 2002-2014 the original author or authors.
|
* Copyright 2002-2016 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.
|
||||||
@@ -17,6 +17,7 @@
|
|||||||
package org.springframework.transaction.interceptor;
|
package org.springframework.transaction.interceptor;
|
||||||
|
|
||||||
import java.lang.reflect.Method;
|
import java.lang.reflect.Method;
|
||||||
|
import java.util.Map;
|
||||||
import java.util.Properties;
|
import java.util.Properties;
|
||||||
import java.util.concurrent.ConcurrentHashMap;
|
import java.util.concurrent.ConcurrentHashMap;
|
||||||
|
|
||||||
@@ -85,7 +86,7 @@ public abstract class TransactionAspectSupport implements BeanFactoryAware, Init
|
|||||||
new NamedThreadLocal<TransactionInfo>("Current aspect-driven transaction");
|
new NamedThreadLocal<TransactionInfo>("Current aspect-driven transaction");
|
||||||
|
|
||||||
|
|
||||||
private final ConcurrentHashMap<Object, PlatformTransactionManager> transactionManagerCache =
|
private final Map<Object, PlatformTransactionManager> transactionManagerCache =
|
||||||
new ConcurrentHashMap<Object, PlatformTransactionManager>();
|
new ConcurrentHashMap<Object, PlatformTransactionManager>();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -243,7 +244,7 @@ public abstract class TransactionAspectSupport implements BeanFactoryAware, Init
|
|||||||
public void afterPropertiesSet() {
|
public void afterPropertiesSet() {
|
||||||
if (getTransactionManager() == null && this.beanFactory == null) {
|
if (getTransactionManager() == null && this.beanFactory == null) {
|
||||||
throw new IllegalStateException(
|
throw new IllegalStateException(
|
||||||
"Setting the property 'transactionManager' or running in a ListableBeanFactory is required");
|
"Setting the property 'transactionManager' or running in a BeanFactory is required");
|
||||||
}
|
}
|
||||||
if (this.transactionAttributeSource == null) {
|
if (this.transactionAttributeSource == null) {
|
||||||
throw new IllegalStateException(
|
throw new IllegalStateException(
|
||||||
@@ -449,17 +450,16 @@ public abstract class TransactionAspectSupport implements BeanFactoryAware, Init
|
|||||||
|
|
||||||
TransactionInfo txInfo = new TransactionInfo(tm, txAttr, joinpointIdentification);
|
TransactionInfo txInfo = new TransactionInfo(tm, txAttr, joinpointIdentification);
|
||||||
if (txAttr != null) {
|
if (txAttr != null) {
|
||||||
// We need a transaction for this method
|
// We need a transaction for this method...
|
||||||
if (logger.isTraceEnabled()) {
|
if (logger.isTraceEnabled()) {
|
||||||
logger.trace("Getting transaction for [" + txInfo.getJoinpointIdentification() + "]");
|
logger.trace("Getting transaction for [" + txInfo.getJoinpointIdentification() + "]");
|
||||||
}
|
}
|
||||||
// The transaction manager will flag an error if an incompatible tx already exists
|
// The transaction manager will flag an error if an incompatible tx already exists.
|
||||||
txInfo.newTransactionStatus(status);
|
txInfo.newTransactionStatus(status);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
// The TransactionInfo.hasTransaction() method will return
|
// The TransactionInfo.hasTransaction() method will return false. We created it only
|
||||||
// false. We created it only to preserve the integrity of
|
// to preserve the integrity of the ThreadLocal stack maintained in this class.
|
||||||
// the ThreadLocal stack maintained in this class.
|
|
||||||
if (logger.isTraceEnabled())
|
if (logger.isTraceEnabled())
|
||||||
logger.trace("Don't need to create transaction for [" + joinpointIdentification +
|
logger.trace("Don't need to create transaction for [" + joinpointIdentification +
|
||||||
"]: This method isn't transactional.");
|
"]: This method isn't transactional.");
|
||||||
|
|||||||
Reference in New Issue
Block a user