preparing for another refactoring...
This commit is contained in:
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user