From aa1f4104cb19f383bcbc74b5f2b018acf3b3f57f Mon Sep 17 00:00:00 2001 From: Joe Di Pol Date: Fri, 3 Jan 2025 12:34:52 -0800 Subject: [PATCH] Mention server lifecycle in webserver SE docs. Fix toc. --- docs/src/main/asciidoc/se/webserver.adoc | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/docs/src/main/asciidoc/se/webserver.adoc b/docs/src/main/asciidoc/se/webserver.adoc index 02e6f091ff6..a852443ac86 100644 --- a/docs/src/main/asciidoc/se/webserver.adoc +++ b/docs/src/main/asciidoc/se/webserver.adoc @@ -1,6 +1,6 @@ /////////////////////////////////////////////////////////////////////////////// - Copyright (c) 2018, 2024 Oracle and/or its affiliates. + Copyright (c) 2018, 2025 Oracle and/or its affiliates. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -34,9 +34,9 @@ include::{rootdir}/includes/se.adoc[] ** <> ** <> ** <> -*** <> -*** <> -*** <> +- <> +** <> +** <> - <> ** <> ** <> @@ -291,6 +291,16 @@ include::{sourcedir}/se/WebServerSnippets.java[tag=snippet_7, indent=0] In this example, the `GET` handler matches requests to `/hello/subpath`. [[anchor-http-feature]] + +=== Server Lifecycle + +In Helidon 4 your `HttpService` can interpose on the server lifecycle by overriding the `beforeStart` and `afterStop` methods: +[source,java] +.Helidon 4.x server lifecycle +---- +include::{sourcedir}/se/guides/Upgrade4xSnippets.java[tag=snippet_10, indent=0] +---- + === Using `HttpFeature` By implementing the `io.helidon.webserver.http.HttpFeature` interface, you can organize multiple routes and/or filters into