cleanupOccursAfterWebServerShutdown() — spring-boot Function Reference
Architecture documentation for the cleanupOccursAfterWebServerShutdown() function in LoggingApplicationListenerTests.java from the spring-boot codebase.
Entity Profile
Dependency Diagram
graph TD 9852c5a3_5ec1_6a92_df81_1e5047b0342d["cleanupOccursAfterWebServerShutdown()"] 9fc735d3_f2de_a77c_c1a1_abf218992bd6["setWebApplicationType()"] 9852c5a3_5ec1_6a92_df81_1e5047b0342d -->|calls| 9fc735d3_f2de_a77c_c1a1_abf218992bd6 ab7d7a5d_2b51_950c_9190_353313bf7e19["getListeners()"] 9852c5a3_5ec1_6a92_df81_1e5047b0342d -->|calls| ab7d7a5d_2b51_950c_9190_353313bf7e19 89cfa04a_3922_680e_945d_5b4338252cc7["run()"] 9852c5a3_5ec1_6a92_df81_1e5047b0342d -->|calls| 89cfa04a_3922_680e_945d_5b4338252cc7 7dbdd22f_6929_2540_3475_c564a673879d["close()"] 9852c5a3_5ec1_6a92_df81_1e5047b0342d -->|calls| 7dbdd22f_6929_2540_3475_c564a673879d 5442b6c9_c948_65c9_3b32_df1993add6a2["getName()"] 9852c5a3_5ec1_6a92_df81_1e5047b0342d -->|calls| 5442b6c9_c948_65c9_3b32_df1993add6a2 e3a6021f_4fd2_4807_668f_6ce7e37fe5d4["get()"] 9852c5a3_5ec1_6a92_df81_1e5047b0342d -->|calls| e3a6021f_4fd2_4807_668f_6ce7e37fe5d4 style 9852c5a3_5ec1_6a92_df81_1e5047b0342d fill:#6366f1,stroke:#818cf8,color:#fff
Relationship Graph
Source Code
core/spring-boot/src/test/java/org/springframework/boot/context/logging/LoggingApplicationListenerTests.java lines 549–574
@Test
void cleanupOccursAfterWebServerShutdown() {
System.setProperty(LoggingSystem.SYSTEM_PROPERTY, TestCleanupLoggingSystem.class.getName());
this.springApplication.setWebApplicationType(WebApplicationType.NONE);
ConfigurableApplicationContext context = this.springApplication.run();
ApplicationListener<?> listener = this.springApplication.getListeners()
.stream()
.filter(LoggingApplicationListener.class::isInstance)
.findFirst()
.get();
TestCleanupLoggingSystem loggingSystem = (TestCleanupLoggingSystem) ReflectionTestUtils.getField(listener,
"loggingSystem");
assertThat(loggingSystem).isNotNull();
assertThat(loggingSystem.cleanedUp).isFalse();
WebServerStyleLifecycle lifecycle = context.getBean(WebServerStyleLifecycle.class);
AtomicBoolean called = new AtomicBoolean();
AtomicBoolean cleanupOnStop = new AtomicBoolean();
lifecycle.onStop = () -> {
called.set(true);
cleanupOnStop.set(loggingSystem.cleanedUp);
};
context.close();
assertThat(called).isTrue();
assertThat(cleanupOnStop).isFalse();
assertThat(loggingSystem.cleanedUp).isTrue();
}
Domain
Subdomains
Source
Frequently Asked Questions
What does cleanupOccursAfterWebServerShutdown() do?
cleanupOccursAfterWebServerShutdown() is a function in the spring-boot codebase.
What does cleanupOccursAfterWebServerShutdown() call?
cleanupOccursAfterWebServerShutdown() calls 6 function(s): close, get, getListeners, getName, run, setWebApplicationType.
Analyze Your Own Codebase
Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.
Try Supermodel Free