Improve MBean without backing Endpoint support
Improve support for MBeans without a backing endpoint by introducing a `JmxEndpoint` interface. The `JmxEndpoint` is intentionally similar in design to the `MvcEndpoint` from the `mvc` package and allows for completely custom JMX beans that are not backed by any real actuator `Endpoint`. The `AuditEventsMBean` has been refactored to use the new interface and has been renamed to `AuditEventsJmxEndpoint`. See gh-6579
This commit is contained in:
@@ -202,8 +202,8 @@ public class ManagementWebSecurityAutoConfigurationTests {
|
||||
HttpMessageConvertersAutoConfiguration.class,
|
||||
EndpointAutoConfiguration.class, EndpointWebMvcAutoConfiguration.class,
|
||||
ManagementServerPropertiesAutoConfiguration.class,
|
||||
WebMvcAutoConfiguration.class,
|
||||
PropertyPlaceholderAutoConfiguration.class, AuditAutoConfiguration.class);
|
||||
WebMvcAutoConfiguration.class, PropertyPlaceholderAutoConfiguration.class,
|
||||
AuditAutoConfiguration.class);
|
||||
this.context.refresh();
|
||||
|
||||
Filter filter = this.context.getBean("springSecurityFilterChain", Filter.class);
|
||||
|
||||
@@ -128,7 +128,7 @@ public class EndpointMBeanExporterTests {
|
||||
this.context.registerBeanDefinition("endpoint1",
|
||||
new RootBeanDefinition(TestEndpoint.class));
|
||||
this.context.registerBeanDefinition("endpoint2",
|
||||
new RootBeanDefinition(TestEndpoint.class));
|
||||
new RootBeanDefinition(TestEndpoint2.class));
|
||||
this.context.refresh();
|
||||
MBeanExporter mbeanExporter = this.context.getBean(EndpointMBeanExporter.class);
|
||||
assertThat(mbeanExporter.getServer()
|
||||
@@ -329,6 +329,10 @@ public class EndpointMBeanExporterTests {
|
||||
|
||||
}
|
||||
|
||||
public static class TestEndpoint2 extends TestEndpoint {
|
||||
|
||||
}
|
||||
|
||||
public static class JsonMapConversionEndpoint
|
||||
extends AbstractEndpoint<Map<String, Object>> {
|
||||
|
||||
|
||||
Reference in New Issue
Block a user