You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Spring Boot provides <<production-ready-features.adoc#production-ready-kubernetes-probes,Kubernetes HTTP probes for "Liveness" and "Readiness" with Actuator Health Endpoints>>.
@@ -380,23 +341,9 @@ TIP: It is often desirable to call `setWebApplicationType(WebApplicationType.NON
380
341
If you need to access the application arguments that were passed to `SpringApplication.run(...)`, you can inject a `org.springframework.boot.ApplicationArguments` bean.
381
342
The `ApplicationArguments` interface provides access to both the raw `String[]` arguments as well as parsed `option` and `non-option` arguments, as shown in the following example:
TIP: Spring Boot also registers a `CommandLinePropertySource` with the Spring `Environment`.
@@ -415,19 +362,9 @@ NOTE: This contract is well suited for tasks that should run after application s
415
362
The `CommandLineRunner` interfaces provides access to application arguments as a string array, whereas the `ApplicationRunner` uses the `ApplicationArguments` interface discussed earlier.
416
363
The following example shows a `CommandLineRunner` with a `run` method:
417
364
418
-
[source,java,pending-extract=true,indent=0]
365
+
[source,java,indent=0]
419
366
----
420
-
import org.springframework.boot.*;
421
-
import org.springframework.stereotype.*;
422
-
423
-
@Component
424
-
public class MyBean implements CommandLineRunner {
If several `CommandLineRunner` or `ApplicationRunner` beans are defined that must be called in a specific order, you can additionally implement the `org.springframework.core.Ordered` interface or use the `org.springframework.core.annotation.Order` annotation.
@@ -473,13 +410,9 @@ This data can be collected for profiling purposes, or just to have a better unde
473
410
You can choose an `ApplicationStartup` implementation when setting up the `SpringApplication` instance.
474
411
For example, to use the `BufferingApplicationStartup`, you could write:
475
412
476
-
[source,java,pending-extract=true,indent=0]
413
+
[source,java,indent=0]
477
414
----
478
-
public static void main(String[] args) {
479
-
SpringApplication app = new SpringApplication(MySpringConfiguration.class);
On your application classpath (for example, inside your jar) you can have an `application.properties` file that provides a sensible default property value for `name`.
@@ -1115,58 +1037,9 @@ TIP: See also the <<boot-features-external-config-vs-value,differences between `
1115
1037
==== JavaBean properties binding
1116
1038
It is possible to bind a bean declaring standard JavaBean properties as shown in the following example:
In this setup, the `@ConstructorBinding` annotation is used to indicate that constructor binding should be used.
@@ -1273,32 +1092,9 @@ Default values can be specified using `@DefaultValue` and the same conversion se
1273
1092
By default, if no properties are bound to `Security`, the `AcmeProperties` instance will contain a `null` value for `security`.
1274
1093
If you wish you return a non-null instance of `Security` even when no properties are bound to it, you can use an empty `@DefaultValue` annotation to do so:
0 commit comments