From c1dea3797a1820c0c5272d52993c5455b59f32fc Mon Sep 17 00:00:00 2001 From: Stephane Nicoll Date: Wed, 10 Jun 2015 13:46:37 +0200 Subject: [PATCH] Add documentation for SpringApplicationAdminMXBean Closes gh-3179 --- .../additional-spring-configuration-metadata.json | 12 ++++++++++++ .../asciidoc/appendix-application-properties.adoc | 4 ++++ .../src/main/asciidoc/spring-boot-features.adoc | 10 ++++++++++ 3 files changed, 26 insertions(+) diff --git a/spring-boot-autoconfigure/src/main/resources/META-INF/additional-spring-configuration-metadata.json b/spring-boot-autoconfigure/src/main/resources/META-INF/additional-spring-configuration-metadata.json index cdab6cf961..52571ef7a2 100644 --- a/spring-boot-autoconfigure/src/main/resources/META-INF/additional-spring-configuration-metadata.json +++ b/spring-boot-autoconfigure/src/main/resources/META-INF/additional-spring-configuration-metadata.json @@ -17,6 +17,18 @@ "description": "Whether subclass-based (CGLIB) proxies are to be created (true) as opposed to standard Java interface-based proxies (false).", "defaultValue": false }, + { + "name": "spring.application.admin.enabled", + "type": "java.lang.Boolean", + "description": "Enable admin features for the application.", + "defaultValue": false + }, + { + "name": "spring.application.admin.jmx-name", + "type": "java.lang.String", + "description": "JMX name of the application admin MBean.", + "defaultValue": "org.springframework.boot:type=Admin,name=SpringApplication" + }, { "name": "spring.batch.job.enabled", "type": "java.lang.Boolean", diff --git a/spring-boot-docs/src/main/asciidoc/appendix-application-properties.adoc b/spring-boot-docs/src/main/asciidoc/appendix-application-properties.adoc index e9a9cd012a..6f7dc62ea2 100644 --- a/spring-boot-docs/src/main/asciidoc/appendix-application-properties.adoc +++ b/spring-boot-docs/src/main/asciidoc/appendix-application-properties.adoc @@ -45,6 +45,10 @@ content into your application; rather pick only the properties that you need. spring.main.show-banner=true spring.main....= # see class for all properties + # ADMIN ({sc-spring-boot-autoconfigure}/admin/SpringApplicationAdminJmxAutoConfiguration.{sc-ext}[SpringApplicationAdminJmxAutoConfiguration]) + spring.application.admin.enabled=false # enable admin features for the application + spring.application.admin.jmx-name=org.springframework.boot:type=Admin,name=SpringApplication # JMX name of the application admin MBean + # OUTPUT spring.output.ansi.enabled=detect # Configure the ANSI output ("detect", "always", "never") diff --git a/spring-boot-docs/src/main/asciidoc/spring-boot-features.adoc b/spring-boot-docs/src/main/asciidoc/spring-boot-features.adoc index 7952e212a4..1f1d8bda06 100644 --- a/spring-boot-docs/src/main/asciidoc/spring-boot-features.adoc +++ b/spring-boot-docs/src/main/asciidoc/spring-boot-features.adoc @@ -218,6 +218,16 @@ be used. In addition, beans may implement the `org.springframework.boot.ExitCodeGenerator` interface if they wish to return a specific exit code when the application ends. +[[boot-features-application-admin]] +=== Admin features +It is possible to enable admin-related features for the application by specifying the +`spring.application.admin.enabled` property. For now, this exposes the +{sc-spring-boot}/admin/SpringApplicationAdminMXBean.{sc-ext}[`SpringApplicationAdminMXBean`]` +on the platform `MBeanServer`. You could use this feature to administer your Spring Boot +application remotely. This could also be useful for any service wrapper implementation. + +NOTE: Be careful when enabling this feature as the MBean exposes a method to shutdown the +application. [[boot-features-external-config]]