Interface ReadinessStateAware
- All Known Implementing Classes:
AbstractMcpRestServlet,ExampleMcpServer,McpRestServlet,McpRestServlet,SecuredExampleMcpServer
ReadinessState, so they
can react when shutdown begins (see ReadinessState.onOutOfService(Object, Runnable)).
The embedded-server lifecycle component (e.g. JettyServerComponent, TomcatServerComponent)
calls acceptReadinessState(ReadinessState) on each auto-discovered servlet that implements this
interface, before the server starts. A typical use is closing long-lived streaming connections at the start
of a graceful shutdown so the drain does not have to wait out its stop timeout for them.
Example:
- Since:
- 10.0.0
-
Method Summary
Modifier and TypeMethodDescriptionvoidReceives the lifecycle-owned readiness state.
-
Method Details
-
acceptReadinessState
Receives the lifecycle-owned readiness state.May be called more than once (once per server start); implementations should register callbacks under a stable key so repeated calls replace rather than accumulate.
- Parameters:
state- The per-service readiness state. Nevernull .
-