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

pl.allegro.tech.servicemesh.envoycontrol.config.service.GenericServiceExtension.kt Maven / Gradle / Ivy

There is a newer version: 0.22.4
Show newest version
package pl.allegro.tech.servicemesh.envoycontrol.config.service

import org.junit.jupiter.api.extension.ExtensionContext
import pl.allegro.tech.servicemesh.envoycontrol.logger

class GenericServiceExtension(private val container: T) : ServiceExtension {

    private val logger by logger()
    private var started = false

    override fun container() = container

    override fun beforeAll(context: ExtensionContext) {
        if (started) {
            return
        }
        logger.info("Generic service is starting.")
        container.start()
        started = true
        logger.info("Generic service extension started.")
    }

    override fun afterAll(context: ExtensionContext) {
        container.stop()
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy