@ -1,5 +1,5 @@
@@ -1,5 +1,5 @@
/ *
* Copyright 2012 - 2024 the original author or authors .
* Copyright 2012 - 2025 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 .
@ -23,7 +23,6 @@ import javax.sql.DataSource;
@@ -23,7 +23,6 @@ import javax.sql.DataSource;
import io.rsocket.transport.netty.server.TcpServerTransport ;
import org.springframework.beans.factory.BeanFactory ;
import org.springframework.beans.factory.ObjectProvider ;
import org.springframework.boot.autoconfigure.AutoConfiguration ;
import org.springframework.boot.autoconfigure.AutoConfigureBefore ;
@ -44,6 +43,7 @@ import org.springframework.boot.context.properties.EnableConfigurationProperties
@@ -44,6 +43,7 @@ import org.springframework.boot.context.properties.EnableConfigurationProperties
import org.springframework.boot.context.properties.PropertyMapper ;
import org.springframework.boot.context.properties.source.MutuallyExclusiveConfigurationPropertiesException ;
import org.springframework.boot.task.ThreadPoolTaskSchedulerBuilder ;
import org.springframework.context.ApplicationContext ;
import org.springframework.context.annotation.Bean ;
import org.springframework.context.annotation.Conditional ;
import org.springframework.context.annotation.Configuration ;
@ -200,14 +200,21 @@ public class IntegrationAutoConfiguration {
@@ -200,14 +200,21 @@ public class IntegrationAutoConfiguration {
protected static class IntegrationJmxConfiguration {
@Bean
public IntegrationMBeanExporter integrationMbeanExporter ( BeanFactory beanFactory , JmxProperties properties ) {
IntegrationMBeanExporter exporter = new IntegrationMBeanExporter ( ) ;
String defaultDomain = properties . getDefaultDomain ( ) ;
if ( StringUtils . hasLength ( defaultDomain ) ) {
exporter . setDefaultDomain ( defaultDomain ) ;
}
exporter . setServer ( beanFactory . getBean ( properties . getServer ( ) , MBeanServer . class ) ) ;
return exporter ;
public static IntegrationMBeanExporter integrationMbeanExporter ( ApplicationContext applicationContext ) {
return new IntegrationMBeanExporter ( ) {
@Override
public void afterSingletonsInstantiated ( ) {
JmxProperties properties = applicationContext . getBean ( JmxProperties . class ) ;
String defaultDomain = properties . getDefaultDomain ( ) ;
if ( StringUtils . hasLength ( defaultDomain ) ) {
setDefaultDomain ( defaultDomain ) ;
}
setServer ( applicationContext . getBean ( properties . getServer ( ) , MBeanServer . class ) ) ;
super . afterSingletonsInstantiated ( ) ;
}
} ;
}
}