Class HttpServer
java.lang.Object
org.nanonative.nano.core.model.Service
org.nanonative.nano.services.http.HttpServer
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final Stringstatic final Stringstatic final intstatic final intprotected HttpServerprotected static final LockFields inherited from class org.nanonative.nano.core.model.Service
context, createdAtMs, isReady -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionaddress()voidconfigure(berlin.yuna.typemap.model.TypeMapI<?> configs, berlin.yuna.typemap.model.TypeMapI<?> merged) protected byte[]encodeBody(byte[] body, String contentEncoding) static booleanisPortInUse(int portNumber) static intnextFreePort(int startPort) voidintport()protected voidsendResponse(HttpExchange exchange, HttpObject request, HttpObject response) server()setError(AtomicBoolean internalError) voidstart()voidstop()Methods inherited from class org.nanonative.nano.core.model.Service
configure, context, context, createdAtMs, isReady, isReadyState, name, nanoThread, receiveEvent, threadsOf
-
Field Details
-
server
-
CONFIG_SERVICE_HTTP_PORT
-
CONFIG_SERVICE_HTTP_CLIENT
-
EVENT_HTTP_REQUEST
public static final int EVENT_HTTP_REQUEST -
EVENT_HTTP_REQUEST_UNHANDLED
public static final int EVENT_HTTP_REQUEST_UNHANDLED -
STARTUP_LOCK
-
-
Constructor Details
-
HttpServer
public HttpServer()
-
-
Method Details
-
address
-
port
public int port() -
server
-
stop
public void stop() -
start
public void start() -
onEvent
-
configure
public void configure(berlin.yuna.typemap.model.TypeMapI<?> configs, berlin.yuna.typemap.model.TypeMapI<?> merged) -
onFailure
-
sendResponse
-
encodeBody
-
nextFreePort
public static int nextFreePort(int startPort) -
isPortInUse
public static boolean isPortInUse(int portNumber) -
setError
-