public abstract class AbstractWebServer<T extends AbstractWebServer<T>>
extends java.lang.Object
| Modifier and Type | Field and Description |
|---|---|
protected Env |
env |
protected int |
port |
protected RoutesProvider |
routesProvider |
protected HttpServerWrapper |
server |
| Modifier | Constructor and Description |
|---|---|
protected |
AbstractWebServer() |
| Modifier and Type | Method and Description |
|---|---|
T |
configure(java.lang.Class<? extends Configuration> configuration) |
T |
configure(Configuration configuration) |
protected Env |
createEnv() |
protected abstract HttpServerWrapper |
createHttpServer(Handler httpHandler,
WebSocketHandler webSocketHandler) |
protected Payload |
errorPage(java.lang.Exception e) |
protected Payload |
errorPage(Payload payload) |
protected Payload |
errorPage(Payload payload,
java.lang.Exception e) |
protected void |
handleHttp(Request request,
Response response) |
protected void |
handleServerError(PayloadWriter payloadWriter,
java.lang.Exception e) |
protected WebSocketListener |
handleWebSocket(Request request,
Response response) |
int |
port() |
T |
start() |
T |
start(int port) |
T |
startOnRandomPort() |
T |
startSSL(int port,
java.util.List<java.nio.file.Path> pathChain,
java.nio.file.Path pathPrivateKey) |
T |
startSSL(int port,
java.util.List<java.nio.file.Path> pathChain,
java.nio.file.Path pathPrivateKey,
java.util.List<java.nio.file.Path> pathTrustAnchors) |
T |
startSSL(int port,
java.nio.file.Path pathCertificate,
java.nio.file.Path pathPrivateKey) |
protected T |
startWithContext(int port,
javax.net.ssl.SSLContext context,
boolean authReq) |
void |
stop() |
protected final Env env
protected HttpServerWrapper server
protected RoutesProvider routesProvider
protected int port
protected abstract HttpServerWrapper createHttpServer(Handler httpHandler, WebSocketHandler webSocketHandler) throws java.lang.Exception
java.lang.Exceptionpublic T configure(Configuration configuration)
public T configure(java.lang.Class<? extends Configuration> configuration)
public T startOnRandomPort()
public T start()
public T start(int port)
public T startSSL(int port, java.nio.file.Path pathCertificate, java.nio.file.Path pathPrivateKey)
public T startSSL(int port, java.util.List<java.nio.file.Path> pathChain, java.nio.file.Path pathPrivateKey)
public T startSSL(int port, java.util.List<java.nio.file.Path> pathChain, java.nio.file.Path pathPrivateKey, java.util.List<java.nio.file.Path> pathTrustAnchors)
protected T startWithContext(int port, javax.net.ssl.SSLContext context, boolean authReq)
public int port()
public void stop()
protected WebSocketListener handleWebSocket(Request request, Response response)
protected void handleServerError(PayloadWriter payloadWriter, java.lang.Exception e)
protected Payload errorPage(java.lang.Exception e)
protected Env createEnv()
Copyright © 2015. All Rights Reserved.