30 lines
708 B
Kotlin
30 lines
708 B
Kotlin
import ActiveMQ.ActiveMQClient
|
|
import Other.Config
|
|
import Web.WebUI
|
|
import database.MySQLInjector
|
|
import org.tinylog.provider.ProviderRegistry
|
|
import java.util.function.Consumer
|
|
|
|
lateinit var config : Config
|
|
fun main() {
|
|
config = Config()
|
|
config.Load()
|
|
val webUI = WebUI()
|
|
webUI.Start()
|
|
val activeclient = ActiveMQClient()
|
|
//activeclient.Start()
|
|
val mysql = MySQLInjector()
|
|
mysql.Start()
|
|
|
|
activeclient.MessageConsumer = Consumer{ message ->
|
|
|
|
}
|
|
|
|
Runtime.getRuntime().addShutdownHook(Thread {
|
|
webUI.Stop()
|
|
activeclient.Stop()
|
|
mysql.Stop()
|
|
// shutdown tinylog properly
|
|
ProviderRegistry.getLoggingProvider().shutdown();
|
|
})
|
|
} |