ShutdownService.ktManages shutdown listeners and ensures they are executed in the correct order before the database connection is closed. Called by ProjectForgeApp during graceful shutdown.
Implements a simple observer pattern: ShutdownListener implementations register with registerListener(). When shutdown() is called, all listeners are invoked in registration order via forEach. This ensures that services relying on database access (like Hibernate Search indexing) can flush their state before the DB pool closes.
ShutdownListener (interface) — defines shutdown() method; implementations include SecurityShutdownListeners registered during application startup via Spring bean initialization. At shutdown, ProjectForgeApp calls shutdown() on this service before closing the database connection pool, allowing listeners to perform final writes, index flushes, or cleanup.
868d6abb7 2026-01-01 2025 -> 2026 63081666f 2025-01-01 Source headers: 2024-> 2025 f8961fd66 2024-12-11 Shutdown handling improved: ShutdownService will shutdown services first before database goes down