Home / Function/ registerShutdownHookIfNecessary() — spring-boot Function Reference

registerShutdownHookIfNecessary() — spring-boot Function Reference

Architecture documentation for the registerShutdownHookIfNecessary() function in LoggingApplicationListener.java from the spring-boot codebase.

Function java GradlePlugin DslExtensions calls 2 called by 1

Entity Profile

Dependency Diagram

graph TD
  f4e1cf64_bf89_e6b9_13ed_f9a2b3a10686["registerShutdownHookIfNecessary()"]
  81d3722d_c4b6_44b8_92ad_5eddf72c432c["initialize()"]
  81d3722d_c4b6_44b8_92ad_5eddf72c432c -->|calls| f4e1cf64_bf89_e6b9_13ed_f9a2b3a10686
  d4f6d0f3_0737_f436_1b72_b1e3ad9d66c3["getShutdownHandler()"]
  f4e1cf64_bf89_e6b9_13ed_f9a2b3a10686 -->|calls| d4f6d0f3_0737_f436_1b72_b1e3ad9d66c3
  aac53ca1_1c99_728c_a9f5_e1db56228ccd["registerShutdownHook()"]
  f4e1cf64_bf89_e6b9_13ed_f9a2b3a10686 -->|calls| aac53ca1_1c99_728c_a9f5_e1db56228ccd
  style f4e1cf64_bf89_e6b9_13ed_f9a2b3a10686 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

core/spring-boot/src/main/java/org/springframework/boot/context/logging/LoggingApplicationListener.java lines 425–432

	private void registerShutdownHookIfNecessary(Environment environment, LoggingSystem loggingSystem) {
		if (environment.getProperty(REGISTER_SHUTDOWN_HOOK_PROPERTY, Boolean.class, true)) {
			Runnable shutdownHandler = loggingSystem.getShutdownHandler();
			if (shutdownHandler != null && shutdownHookRegistered.compareAndSet(false, true)) {
				registerShutdownHook(shutdownHandler);
			}
		}
	}

Domain

Subdomains

Called By

Frequently Asked Questions

What does registerShutdownHookIfNecessary() do?
registerShutdownHookIfNecessary() is a function in the spring-boot codebase.
What does registerShutdownHookIfNecessary() call?
registerShutdownHookIfNecessary() calls 2 function(s): getShutdownHandler, registerShutdownHook.
What calls registerShutdownHookIfNecessary()?
registerShutdownHookIfNecessary() is called by 1 function(s): initialize.

Analyze Your Own Codebase

Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.

Try Supermodel Free