MCPcopy Index your code
hub / github.com/CSpyridakis/notes / main

Method main

Java/Maven-http-server/src/main/java/com/example/App.java:17–33  ·  view source on GitHub ↗
(String[] args)

Source from the content-addressed store, hash-verified

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 {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected