From b1ac6b18bdbae97bdcb278ca1b2b34009fa50f25 Mon Sep 17 00:00:00 2001 From: cjkent Date: Fri, 9 Feb 2024 16:18:28 +0000 Subject: [PATCH] Switch to Jakarta servlet, remove Java 8 support --- aws/src/main/kotlin/ws/osiris/aws/Config.kt | 13 ++++++++----- .../kotlin/ws/osiris/localserver/LocalServer.kt | 10 +++++----- 2 files changed, 13 insertions(+), 10 deletions(-) diff --git a/aws/src/main/kotlin/ws/osiris/aws/Config.kt b/aws/src/main/kotlin/ws/osiris/aws/Config.kt index e9224f6c..59ffb86c 100644 --- a/aws/src/main/kotlin/ws/osiris/aws/Config.kt +++ b/aws/src/main/kotlin/ws/osiris/aws/Config.kt @@ -89,11 +89,11 @@ data class ApplicationConfig( /** * The runtime that should be used for the Osiris lambda function. * - * This should normally be left as the default ([LambdaRuntime.Java8]). + * This should normally be left as the default ([LambdaRuntime.Java11]). * * If you specify a layer that provides an alternative runtime then use [LambdaRuntime.Provided]. */ - val runtime: LambdaRuntime = LambdaRuntime.Java8 + val runtime: LambdaRuntime = LambdaRuntime.Java11 ) { init { check(stages.isNotEmpty()) { "There must be at least one stage defined in the configuration" } @@ -224,12 +224,15 @@ interface ApiFactory { */ enum class LambdaRuntime(val runtimeName: String) { - /** The AWS Java 8 lambda runtime. */ - Java8("java8"), - /** The AWS Java 11 lambda runtime. */ Java11("java11"), + /** The AWS Java 17 lambda runtime. */ + Java17("java17"), + + /** The AWS Java 21 lambda runtime. */ + Java21("java21"), + /** A custom runtime provided by one of the [layers][ApplicationConfig.layers] */ Provided("provided"); } diff --git a/local-server/src/main/kotlin/ws/osiris/localserver/LocalServer.kt b/local-server/src/main/kotlin/ws/osiris/localserver/LocalServer.kt index 19ff3f93..9b8b2121 100644 --- a/local-server/src/main/kotlin/ws/osiris/localserver/LocalServer.kt +++ b/local-server/src/main/kotlin/ws/osiris/localserver/LocalServer.kt @@ -24,10 +24,10 @@ import java.io.BufferedReader import java.io.InputStreamReader import java.nio.file.Paths import java.util.stream.Collectors.joining -import javax.servlet.ServletConfig -import javax.servlet.http.HttpServlet -import javax.servlet.http.HttpServletRequest -import javax.servlet.http.HttpServletResponse +import jakarta.servlet.ServletConfig +import jakarta.servlet.http.HttpServlet +import jakarta.servlet.http.HttpServletRequest +import jakarta.servlet.http.HttpServletResponse private val log = LoggerFactory.getLogger("ws.osiris.localserver") @@ -116,7 +116,7 @@ private fun HttpServletResponse.write(httpStatus: Int, headers: Headers, body: A * runs and joins the server, so the method never returns and the server can only be stopped by killing * the process. * - * The `contextRoot` argument controls the URL on which the API is available. By default the API is + * The `contextRoot` argument controls the URL on which the API is available. By default, the API is * available at: * * http://localhost:8080/