Skip to content

Commit

Permalink
Switch to Jakarta servlet, remove Java 8 support
Browse files Browse the repository at this point in the history
  • Loading branch information
cjkent committed Feb 9, 2024
1 parent c539025 commit b1ac6b1
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 10 deletions.
13 changes: 8 additions & 5 deletions aws/src/main/kotlin/ws/osiris/aws/Config.kt
Original file line number Diff line number Diff line change
Expand Up @@ -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" }
Expand Down Expand Up @@ -224,12 +224,15 @@ interface ApiFactory<T : ComponentsProvider> {
*/
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");
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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")

Expand Down Expand Up @@ -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/
Expand Down

0 comments on commit b1ac6b1

Please sign in to comment.