Skip to content

Commit c9078bf

Browse files
committed
Introduce @ConcurrencyLimit annotation based on ConcurrencyThrottleInterceptor
Moves @retryable infrastructure to resilience package in spring-context module. Includes duration parsing and placeholder resolution for @retryable attributes. Provides convenient @EnableResilientMethods for @retryable + @ConcurrencyLimit. Closes gh-35133 See gh-34529
1 parent 3ce7613 commit c9078bf

23 files changed

+1112
-405
lines changed

spring-aop/src/main/java/org/springframework/aop/framework/autoproxy/AbstractBeanFactoryAwareAdvisingPostProcessor.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@
4141
public abstract class AbstractBeanFactoryAwareAdvisingPostProcessor extends AbstractAdvisingBeanPostProcessor
4242
implements BeanFactoryAware {
4343

44-
private @Nullable ConfigurableListableBeanFactory beanFactory;
44+
protected @Nullable ConfigurableListableBeanFactory beanFactory;
4545

4646

4747
@Override

spring-aop/src/main/java/org/springframework/aop/interceptor/ConcurrencyThrottleInterceptor.java

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,10 +44,24 @@
4444
public class ConcurrencyThrottleInterceptor extends ConcurrencyThrottleSupport
4545
implements MethodInterceptor, Serializable {
4646

47+
/**
48+
* Create a default {@code ConcurrencyThrottleInterceptor}
49+
* with concurrency limit 1.
50+
*/
4751
public ConcurrencyThrottleInterceptor() {
48-
setConcurrencyLimit(1);
52+
this(1);
4953
}
5054

55+
/**
56+
* Create a default {@code ConcurrencyThrottleInterceptor}
57+
* with the given concurrency limit.
58+
* @since 7.0
59+
*/
60+
public ConcurrencyThrottleInterceptor(int concurrencyLimit) {
61+
setConcurrencyLimit(concurrencyLimit);
62+
}
63+
64+
5165
@Override
5266
public @Nullable Object invoke(MethodInvocation methodInvocation) throws Throwable {
5367
beforeAccess();

spring-aop/src/main/java/org/springframework/aop/retry/annotation/RetryAnnotationBeanPostProcessor.java

Lines changed: 0 additions & 46 deletions
This file was deleted.

spring-aop/src/main/java/org/springframework/aop/retry/annotation/RetryAnnotationInterceptor.java

Lines changed: 0 additions & 96 deletions
This file was deleted.

spring-aop/src/main/java/org/springframework/aop/retry/annotation/Retryable.java

Lines changed: 0 additions & 155 deletions
This file was deleted.

spring-aop/src/main/java/org/springframework/aop/retry/annotation/package-info.java

Lines changed: 0 additions & 7 deletions
This file was deleted.

0 commit comments

Comments
 (0)