preparing for another refactoring...

This commit is contained in:
Relism
2026-03-29 23:16:41 +02:00
parent 2edd68b0aa
commit b5d4481502
69 changed files with 4329 additions and 1076 deletions
@@ -1,26 +1,22 @@
package dev.relism;
import dev.relism.extension.FlashConfiguration;
import dev.relism.routing.GlobalRouter;
import dev.relism.routing.AbstractRouter;
import java.io.IOException;
import java.util.concurrent.CompletableFuture;
/**
* Public handle to the underlying HTTP transport. Returned by {@link #create} so that
* {@link dev.relism.extension.FlashApp} can start and stop the server without holding
* a direct reference to the package-private {@link HttpServer}.
* Public handle to the underlying HTTP transport. Returned by {@link #create}
* so that {@link dev.relism.extension.FlashApp} can start and stop the server
* without holding a direct reference to the package-private {@link HttpServer}.
*/
public interface ServerHandle {
CompletableFuture<Void> start();
CompletableFuture<Void> stop();
/**
* Creates the HTTP transport. Called exclusively by
* {@link dev.relism.extension.FlashApp}.
*/
static ServerHandle create(FlashConfiguration config, GlobalRouter router) throws IOException {
static ServerHandle create(FlashConfiguration config, AbstractRouter router) throws IOException {
return new HttpServer(config, router);
}
}