diff options
Diffstat (limited to 'subprojects/language-web/src/main/java/tools/refinery/language/web/ServerLauncher.java')
-rw-r--r-- | subprojects/language-web/src/main/java/tools/refinery/language/web/ServerLauncher.java | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/subprojects/language-web/src/main/java/tools/refinery/language/web/ServerLauncher.java b/subprojects/language-web/src/main/java/tools/refinery/language/web/ServerLauncher.java index f49f46ee..ad19e77d 100644 --- a/subprojects/language-web/src/main/java/tools/refinery/language/web/ServerLauncher.java +++ b/subprojects/language-web/src/main/java/tools/refinery/language/web/ServerLauncher.java | |||
@@ -1,4 +1,10 @@ | |||
1 | /* | 1 | /* |
2 | * SPDX-FileCopyrightText: 2021-2023 The Refinery Authors <https://refinery.tools/> | ||
3 | * | ||
4 | * SPDX-License-Identifier: EPL-2.0 | ||
5 | */ | ||
6 | |||
7 | /* | ||
2 | * generated by Xtext 2.25.0 | 8 | * generated by Xtext 2.25.0 |
3 | */ | 9 | */ |
4 | package tools.refinery.language.web; | 10 | package tools.refinery.language.web; |
@@ -13,6 +19,7 @@ import org.eclipse.jetty.ee10.websocket.server.config.JettyWebSocketServletConta | |||
13 | import org.eclipse.jetty.server.Server; | 19 | import org.eclipse.jetty.server.Server; |
14 | import org.eclipse.jetty.util.resource.Resource; | 20 | import org.eclipse.jetty.util.resource.Resource; |
15 | import org.eclipse.jetty.util.resource.ResourceFactory; | 21 | import org.eclipse.jetty.util.resource.ResourceFactory; |
22 | import org.eclipse.jetty.util.thread.QueuedThreadPool; | ||
16 | import org.slf4j.Logger; | 23 | import org.slf4j.Logger; |
17 | import org.slf4j.LoggerFactory; | 24 | import org.slf4j.LoggerFactory; |
18 | import tools.refinery.language.web.config.BackendConfigServlet; | 25 | import tools.refinery.language.web.config.BackendConfigServlet; |
@@ -43,7 +50,8 @@ public class ServerLauncher { | |||
43 | private final Server server; | 50 | private final Server server; |
44 | 51 | ||
45 | public ServerLauncher(InetSocketAddress bindAddress, String[] allowedOrigins, String webSocketUrl) { | 52 | public ServerLauncher(InetSocketAddress bindAddress, String[] allowedOrigins, String webSocketUrl) { |
46 | server = VirtualThreadUtils.newServerWithVirtualThreadsThreadPool("jetty", bindAddress); | 53 | server = new Server(bindAddress); |
54 | ((QueuedThreadPool) server.getThreadPool()).setName("jetty"); | ||
47 | var handler = new ServletContextHandler(); | 55 | var handler = new ServletContextHandler(); |
48 | addSessionHandler(handler); | 56 | addSessionHandler(handler); |
49 | addProblemServlet(handler, allowedOrigins); | 57 | addProblemServlet(handler, allowedOrigins); |
@@ -105,7 +113,7 @@ public class ServerLauncher { | |||
105 | var indexUrlInJar = ServerLauncher.class.getResource("/webapp/index.html"); | 113 | var indexUrlInJar = ServerLauncher.class.getResource("/webapp/index.html"); |
106 | if (indexUrlInJar != null) { | 114 | if (indexUrlInJar != null) { |
107 | // If the app is packaged in the jar, serve it. | 115 | // If the app is packaged in the jar, serve it. |
108 | URI webRootUri = null; | 116 | URI webRootUri; |
109 | try { | 117 | try { |
110 | webRootUri = URI.create(indexUrlInJar.toURI().toASCIIString().replaceFirst("/index.html$", "/")); | 118 | webRootUri = URI.create(indexUrlInJar.toURI().toASCIIString().replaceFirst("/index.html$", "/")); |
111 | } catch (URISyntaxException e) { | 119 | } catch (URISyntaxException e) { |