From 4c66a044d5b8d9e47e0dd0f7cd1c09f25f74e143 Mon Sep 17 00:00:00 2001 From: Chris Beams Date: Thu, 2 Jun 2011 06:49:15 +0000 Subject: [PATCH] Revert "Introduce Ordered#NOT_ORDERED" This reverts commit da914bcfb4599ebf746ea477c691ed99c4842ed0 and also removes the use of Ordered#NOT_ORDERED from EnableTransactionManagement and ProxyTransactionManagementConfiguration in favor of defaulting to Ordered#LOWEST_PRIORITY, which is actually the default that results when no 'order' attribute is specified in XML. git-svn-id: https://src.springframework.org/svn/spring-framework/trunk@4404 50f2f4bb-b051-0410-bef5-90022cba6387 --- .../src/main/java/org/springframework/core/Ordered.java | 8 -------- .../annotation/EnableTransactionManagement.java | 4 ++-- .../ProxyTransactionManagementConfiguration.java | 6 +----- 3 files changed, 3 insertions(+), 15 deletions(-) diff --git a/org.springframework.core/src/main/java/org/springframework/core/Ordered.java b/org.springframework.core/src/main/java/org/springframework/core/Ordered.java index 730766f7ccb..86e8dca364f 100644 --- a/org.springframework.core/src/main/java/org/springframework/core/Ordered.java +++ b/org.springframework.core/src/main/java/org/springframework/core/Ordered.java @@ -47,14 +47,6 @@ public interface Ordered { */ int LOWEST_PRECEDENCE = Integer.MAX_VALUE; - /** - * A reserved integer value indicating that a component should - * be treated as unordered. Users should avoid this using this - * reserved value ({@value}) when ordering their own components. - * Useful when populating annotation, where null cannot be specified - * as a default for integer attributes. - */ - int NOT_ORDERED = (Integer.MIN_VALUE +1) / 2; // -1073741823 /** * Return the order value of this object, with a diff --git a/org.springframework.transaction/src/main/java/org/springframework/transaction/annotation/EnableTransactionManagement.java b/org.springframework.transaction/src/main/java/org/springframework/transaction/annotation/EnableTransactionManagement.java index eb9def90709..b425e44d175 100644 --- a/org.springframework.transaction/src/main/java/org/springframework/transaction/annotation/EnableTransactionManagement.java +++ b/org.springframework.transaction/src/main/java/org/springframework/transaction/annotation/EnableTransactionManagement.java @@ -52,7 +52,7 @@ public @interface EnableTransactionManagement { /** * Indicate the ordering of the execution of the transaction advisor * when multiple advices are applied at a specific joinpoint. - * The default is to not explicitly order the advisor. + * The default is lowest priority. */ - int order() default Ordered.NOT_ORDERED; + int order() default Ordered.LOWEST_PRECEDENCE; } diff --git a/org.springframework.transaction/src/main/java/org/springframework/transaction/annotation/ProxyTransactionManagementConfiguration.java b/org.springframework.transaction/src/main/java/org/springframework/transaction/annotation/ProxyTransactionManagementConfiguration.java index 16953a71207..a28acf77999 100644 --- a/org.springframework.transaction/src/main/java/org/springframework/transaction/annotation/ProxyTransactionManagementConfiguration.java +++ b/org.springframework.transaction/src/main/java/org/springframework/transaction/annotation/ProxyTransactionManagementConfiguration.java @@ -22,7 +22,6 @@ import org.springframework.beans.factory.config.BeanDefinition; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import org.springframework.context.annotation.Role; -import org.springframework.core.Ordered; import org.springframework.transaction.config.TransactionManagementConfigUtils; import org.springframework.transaction.interceptor.BeanFactoryTransactionAttributeSourceAdvisor; import org.springframework.transaction.interceptor.TransactionAttributeSource; @@ -38,10 +37,7 @@ public class ProxyTransactionManagementConfiguration extends AbstractTransaction new BeanFactoryTransactionAttributeSourceAdvisor(); advisor.setTransactionAttributeSource(transactionAttributeSource()); advisor.setAdvice(transactionInterceptor()); - int order = (Integer)this.enableTx.get("order"); - if (order != Ordered.NOT_ORDERED) { - advisor.setOrder(order); - } + advisor.setOrder(((Integer)this.enableTx.get("order"))); return advisor; }