All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.github.squirrelgrip.scientist4k.http.server.HttpExperimentServer.kt Maven / Gradle / Ivy

There is a newer version: 0.10.5
Show newest version
package com.github.squirrelgrip.scientist4k.http.server

import com.github.squirrelgrip.extension.json.toInstance
import com.github.squirrelgrip.scientist4k.http.core.configuration.ServerConfiguration
import com.github.squirrelgrip.scientist4k.http.core.server.SecuredServer
import java.io.File

class HttpExperimentServer(
        serverConfiguration: ServerConfiguration,
        httpExperimentHandler: HttpExperimentHandler
): SecuredServer(serverConfiguration, httpExperimentHandler) {
    constructor(
            httpExperimentConfiguration: HttpExperimentConfiguration
    ): this(httpExperimentConfiguration.server, HttpExperimentHandler(httpExperimentConfiguration))

    constructor(
            serverConfiguration: ServerConfiguration,
            httpExperiment: HttpExperiment
    ): this(serverConfiguration, HttpExperimentHandler(httpExperiment))
}

fun main() {
    val httpExperimentConfiguration = File("experiment-config.json").toInstance()
    val server = HttpExperimentServer(
            httpExperimentConfiguration
    )
    server.start()
    server.join()
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy