Mitigate some IntegrationMBeanExporter early BF access
* Fix typo in the `spring-integration.xsd`
This commit is contained in:
@@ -9,7 +9,7 @@
|
||||
http://www.springframework.org/schema/beans https://www.springframework.org/schema/beans/spring-beans.xsd
|
||||
http://www.springframework.org/schema/util https://www.springframework.org/schema/util/spring-util.xsd">
|
||||
|
||||
<bean id="mbs" class="org.springframework.jmx.support.MBeanServerFactoryBean"/>
|
||||
<bean id="mbs" class="org.springframework.jmx.support.MBeanServerFactoryBean" />
|
||||
|
||||
<si:channel id="testChannel"/>
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2018-2022 the original author or authors.
|
||||
* Copyright 2018-2024 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -24,8 +24,10 @@ import javax.management.ObjectName;
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
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.integration.config.EnableIntegration;
|
||||
import org.springframework.integration.dsl.IntegrationFlow;
|
||||
import org.springframework.integration.dsl.context.IntegrationFlowContext;
|
||||
@@ -98,6 +100,7 @@ public class DslMBeanTests {
|
||||
public static class Config {
|
||||
|
||||
@Bean
|
||||
@Role(BeanDefinition.ROLE_INFRASTRUCTURE)
|
||||
public static MBeanServerFactoryBean mbeanServer() {
|
||||
return new MBeanServerFactoryBean();
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2014-2022 the original author or authors.
|
||||
* Copyright 2014-2024 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -27,9 +27,11 @@ import org.junit.jupiter.api.Test;
|
||||
|
||||
import org.springframework.beans.factory.BeanFactory;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.beans.factory.config.BeanDefinition;
|
||||
import org.springframework.context.ApplicationContextInitializer;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
import org.springframework.context.annotation.Role;
|
||||
import org.springframework.context.support.GenericApplicationContext;
|
||||
import org.springframework.integration.channel.QueueChannel;
|
||||
import org.springframework.integration.config.EnableIntegration;
|
||||
@@ -107,10 +109,12 @@ public class EnableMBeanExportTests {
|
||||
defaultDomain = "${managed.domain}",
|
||||
managedComponents = {"input", "${managed.component}"})
|
||||
@EnableIntegrationManagement(defaultLoggingEnabled = "false")
|
||||
@Role(BeanDefinition.ROLE_INFRASTRUCTURE)
|
||||
public static class ContextConfiguration {
|
||||
|
||||
@Bean
|
||||
public MBeanServerFactoryBean mbeanServer() {
|
||||
@Role(BeanDefinition.ROLE_INFRASTRUCTURE)
|
||||
public static MBeanServerFactoryBean mbeanServer() {
|
||||
return new MBeanServerFactoryBean();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user