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

runWhenContextIsClosedDirectlyRunsHandlerActions() — spring-boot Function Reference

Architecture documentation for the runWhenContextIsClosedDirectlyRunsHandlerActions() function in SpringApplicationShutdownHookTests.java from the spring-boot codebase.

Entity Profile

Dependency Diagram

graph TD
  10ef5860_d52b_644b_0a81_2b807856c661["runWhenContextIsClosedDirectlyRunsHandlerActions()"]
  68f49705_57e4_b3a9_1729_c26b8da322bd["TestApplicationContext()"]
  10ef5860_d52b_644b_0a81_2b807856c661 -->|calls| 68f49705_57e4_b3a9_1729_c26b8da322bd
  9c40d12c_612f_fd8f_523a_f8d6efdf1684["TestHandlerAction()"]
  10ef5860_d52b_644b_0a81_2b807856c661 -->|calls| 9c40d12c_612f_fd8f_523a_f8d6efdf1684
  b29bf6ca_0612_c857_a66f_9b3d1500e547["run()"]
  10ef5860_d52b_644b_0a81_2b807856c661 -->|calls| b29bf6ca_0612_c857_a66f_9b3d1500e547
  style 10ef5860_d52b_644b_0a81_2b807856c661 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

core/spring-boot/src/test/java/org/springframework/boot/SpringApplicationShutdownHookTests.java lines 139–153

	@Test
	void runWhenContextIsClosedDirectlyRunsHandlerActions() {
		TestSpringApplicationShutdownHook shutdownHook = new TestSpringApplicationShutdownHook();
		List<Object> finished = new CopyOnWriteArrayList<>();
		ConfigurableApplicationContext context = new TestApplicationContext(finished);
		shutdownHook.registerApplicationContext(context);
		context.refresh();
		context.close();
		Runnable handlerAction1 = new TestHandlerAction(finished);
		Runnable handlerAction2 = new TestHandlerAction(finished);
		shutdownHook.getHandlers().add(handlerAction1);
		shutdownHook.getHandlers().add(handlerAction2);
		shutdownHook.run();
		assertThat(finished).contains(handlerAction1, handlerAction2);
	}

Domain

Subdomains

Frequently Asked Questions

What does runWhenContextIsClosedDirectlyRunsHandlerActions() do?
runWhenContextIsClosedDirectlyRunsHandlerActions() is a function in the spring-boot codebase.
What does runWhenContextIsClosedDirectlyRunsHandlerActions() call?
runWhenContextIsClosedDirectlyRunsHandlerActions() calls 3 function(s): TestApplicationContext, TestHandlerAction, run.

Analyze Your Own Codebase

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

Try Supermodel Free