MCPcopy Create free account
hub / github.com/CSpyridakis/notes / App

Class App

Java/Maven-http-server/src/main/java/com/example/App.java:14–34  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

12import java.util.logging.Logger;
13
14public class App {
15 private static final Logger LOGGER = Logger.getLogger(App.class.getName());
16
17 public static void main(String[] args) {
18 int serverCount = 3; // Number of Tomcat instances
19 int basePort = 57890;
20
21 ExecutorService executor = Executors.newFixedThreadPool(serverCount);
22 List<TomcatServer> servers = new ArrayList<>();
23
24 for (int i = 0; i < serverCount; i++) {
25 int port = basePort + i;
26 TomcatServer server = new TomcatServer(port);
27 servers.add(server);
28 executor.submit(server);
29 }
30
31 // Allow servers to run in parallel
32 executor.shutdown();
33 }
34}
35
36class TomcatServer implements Runnable {
37 private final int port;

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected