Home / Class/ Handlers Class — spring-boot Architecture

Handlers Class — spring-boot Architecture

Architecture documentation for the Handlers class in SpringApplicationShutdownHook.java from the spring-boot codebase.

Entity Profile

Source Code

core/spring-boot/src/main/java/org/springframework/boot/SpringApplicationShutdownHook.java lines 174–207

	private final class Handlers implements SpringApplicationShutdownHandlers, Runnable {

		private final Set<Handler> actions = new LinkedHashSet<>();

		@Override
		public void add(Runnable action) {
			Assert.notNull(action, "'action' must not be null");
			addRuntimeShutdownHookIfNecessary();
			synchronized (SpringApplicationShutdownHook.class) {
				assertNotInProgress();
				this.actions.add(new Handler(action));
			}
		}

		@Override
		public void remove(Runnable action) {
			Assert.notNull(action, "'action' must not be null");
			synchronized (SpringApplicationShutdownHook.class) {
				assertNotInProgress();
				this.actions.remove(new Handler(action));
			}
		}

		Set<Handler> getActions() {
			return this.actions;
		}

		@Override
		public void run() {
			SpringApplicationShutdownHook.this.run();
			SpringApplicationShutdownHook.this.reset();
		}

	}

Analyze Your Own Codebase

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

Try Supermodel Free