This commit ensures that Health probes are automatically enabled when
the application runs on Cloud Foundry. This was already the case for
Kubernetes, but now that Cloud Foundry supports this feature we should
do the same.
Closes gh-39804
Prior to this commit, Spring applications and libraries would call
`Schedulers.boundedElastic()` or similar static methods at runtime. This
would ininitialize and cache reactive schedulers for the Reactor core
library. Those instances are cached for the lifetime of the JVM and are
shared static instances.
In a WAR deployment case, those schedulers would be initialized and
tied to the web application servlet context class loader. When
undeploying the web applications, schedulers would not be automatically
shut down and this would keep the now useless application classloader,
leaking resources.
This commit ensures that Spring Boot shuts down shared schedulers if
they were loaded and initiazed by the web application classloader, once
the the Spring application context is closed.
Closes gh-41548
As of spring-projects/spring-framework#24560, Spring provides additional
metadata for scheduled tasks:
* next execution time
* last execution outcome (including status, time and raised exception)
This commit leverages this information to enhance the existing
`scheduledtasks` Actuator endpoint.
Closes gh-17585
The use of method references requires the referenced method to be
present even if it isn't called. This made it impossible for Gradle
to remove the deprecated methods as it would break our plugin.
By switching the lambdas, the methods only have to be present when
they're called which will only happen with Gradle 8.2 and earlier.
Closes gh-41599