Skip to content

Commit d0ceefe

Browse files
committed
Mark XML-configured executor/scheduler as infrastructure bean
Closes gh-34015
1 parent e230ea5 commit d0ceefe

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

spring-context/src/main/java/org/springframework/scheduling/config/ExecutorBeanDefinitionParser.java

+3-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2024 the original author or authors.
2+
* Copyright 2002-2025 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -18,6 +18,7 @@
1818

1919
import org.w3c.dom.Element;
2020

21+
import org.springframework.beans.factory.config.BeanDefinition;
2122
import org.springframework.beans.factory.support.BeanDefinitionBuilder;
2223
import org.springframework.beans.factory.support.RootBeanDefinition;
2324
import org.springframework.beans.factory.xml.AbstractSingleBeanDefinitionParser;
@@ -53,6 +54,7 @@ protected void doParse(Element element, ParserContext parserContext, BeanDefinit
5354
if (StringUtils.hasText(poolSize)) {
5455
builder.addPropertyValue("poolSize", poolSize);
5556
}
57+
builder.setRole(BeanDefinition.ROLE_INFRASTRUCTURE);
5658
}
5759

5860
private void configureRejectionPolicy(Element element, BeanDefinitionBuilder builder) {

spring-context/src/main/java/org/springframework/scheduling/config/SchedulerBeanDefinitionParser.java

+3-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2012 the original author or authors.
2+
* Copyright 2002-2025 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -18,6 +18,7 @@
1818

1919
import org.w3c.dom.Element;
2020

21+
import org.springframework.beans.factory.config.BeanDefinition;
2122
import org.springframework.beans.factory.support.BeanDefinitionBuilder;
2223
import org.springframework.beans.factory.xml.AbstractSingleBeanDefinitionParser;
2324
import org.springframework.util.StringUtils;
@@ -41,6 +42,7 @@ protected void doParse(Element element, BeanDefinitionBuilder builder) {
4142
if (StringUtils.hasText(poolSize)) {
4243
builder.addPropertyValue("poolSize", poolSize);
4344
}
45+
builder.setRole(BeanDefinition.ROLE_INFRASTRUCTURE);
4446
}
4547

4648
}

0 commit comments

Comments
 (0)