• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

TAKETODAY / today-infrastructure / 20224960533

15 Dec 2025 08:11AM UTC coverage: 84.388% (-0.02%) from 84.404%
20224960533

push

github

TAKETODAY
:white_check_mark: 在测试中排除 jacoco 初始化方法以避免干扰

61869 of 78367 branches covered (78.95%)

Branch coverage included in aggregate %.

145916 of 167860 relevant lines covered (86.93%)

3.71 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

81.25
today-context/src/main/java/infra/resilience/annotation/ResilientMethodsConfiguration.java
1
/*
2
 * Copyright 2017 - 2025 the original author or authors.
3
 *
4
 * This program is free software: you can redistribute it and/or modify
5
 * it under the terms of the GNU General Public License as published by
6
 * the Free Software Foundation, either version 3 of the License, or
7
 * (at your option) any later version.
8
 *
9
 * This program is distributed in the hope that it will be useful,
10
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12
 * GNU General Public License for more details.
13
 *
14
 * You should have received a copy of the GNU General Public License
15
 * along with this program. If not, see [https://www.gnu.org/licenses/]
16
 */
17

18
package infra.resilience.annotation;
19

20
import org.jspecify.annotations.Nullable;
21

22
import infra.aop.framework.ProxyProcessorSupport;
23
import infra.beans.factory.config.BeanDefinition;
24
import infra.context.annotation.Bean;
25
import infra.context.annotation.Configuration;
26
import infra.context.annotation.ImportAware;
27
import infra.context.annotation.Role;
28
import infra.core.annotation.AnnotationAttributes;
29
import infra.core.type.AnnotationMetadata;
30

31
/**
32
 * {@code @Configuration} class that registers the Spring infrastructure beans necessary
33
 * to enable proxy-based method invocations with retry and concurrency limit behavior.
34
 *
35
 * @author Juergen Hoeller
36
 * @author <a href="https://github.com/TAKETODAY">海子 Yang</a>
37
 * @see EnableResilientMethods
38
 * @see ConcurrencyLimitBeanPostProcessor
39
 * @since 5.0
40
 */
41
@Configuration(proxyBeanMethods = false)
42
@Role(BeanDefinition.ROLE_INFRASTRUCTURE)
43
public class ResilientMethodsConfiguration implements ImportAware {
3✔
44

45
  private @Nullable AnnotationAttributes enableResilientMethods;
46

47
  @Override
48
  public void setImportMetadata(AnnotationMetadata importMetadata) {
49
    this.enableResilientMethods = AnnotationAttributes.fromMap(
5✔
50
            importMetadata.getAnnotationAttributes(EnableResilientMethods.class.getName()));
2✔
51
  }
1✔
52

53
  @Bean(name = "infra.resilience.annotation.internalConcurrencyLimitProcessor")
54
  @Role(BeanDefinition.ROLE_INFRASTRUCTURE)
55
  public ConcurrencyLimitBeanPostProcessor concurrencyLimitAdvisor() {
56
    ConcurrencyLimitBeanPostProcessor bpp = new ConcurrencyLimitBeanPostProcessor();
4✔
57
    configureProxySupport(bpp);
3✔
58
    return bpp;
2✔
59
  }
60

61
  private void configureProxySupport(ProxyProcessorSupport proxySupport) {
62
    if (this.enableResilientMethods != null) {
3!
63
      if (this.enableResilientMethods.getBoolean("proxyTargetClass")) {
5!
64
        proxySupport.setProxyTargetClass(true);
×
65
      }
66
      proxySupport.setOrder(this.enableResilientMethods.getNumber("order"));
8✔
67
    }
68
  }
1✔
69

70
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc