File tree Expand file tree Collapse file tree
src/main/kotlin/co/statu/rule/database Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -10,7 +10,6 @@ import io.vertx.core.json.JsonObject
1010import io.vertx.jdbcclient.JDBCPool
1111import org.slf4j.Logger
1212import org.springframework.beans.factory.config.ConfigurableBeanFactory
13- import org.springframework.context.annotation.Lazy
1413import org.springframework.context.annotation.Scope
1514import org.springframework.stereotype.Component
1615import java.sql.BatchUpdateException
@@ -21,8 +20,12 @@ import kotlin.system.exitProcess
2120class DatabaseManager (
2221 private val vertx : Vertx ,
2322 private val logger : Logger ,
24- @Lazy private val pluginConfigManager : PluginConfigManager < DatabaseConfig >
23+ private val databasePlugin : DatabasePlugin
2524) {
25+ private val pluginConfigManager by lazy {
26+ databasePlugin.pluginBeanContext.getBean(PluginConfigManager ::class .java) as PluginConfigManager <DatabaseConfig >
27+ }
28+
2629 private lateinit var pool: JDBCPool
2730
2831 private val tables = mutableMapOf<ParsekPlugin , MutableList <Dao <* >>>()
Original file line number Diff line number Diff line change @@ -9,14 +9,16 @@ import co.statu.rule.database.DatabaseConfig
99import co.statu.rule.database.DatabaseManager
1010import co.statu.rule.database.DatabasePlugin
1111import org.slf4j.Logger
12- import org.springframework.context.annotation.Lazy
1312
1413@EventListener
1514class CoreEventHandler (
1615 private val logger : Logger ,
1716 private val databasePlugin : DatabasePlugin ,
18- @Lazy private val databaseManager : DatabaseManager
1917) : CoreEventListener {
18+ private val databaseManager by lazy {
19+ databasePlugin.pluginBeanContext.getBean(DatabaseManager ::class .java)
20+ }
21+
2022 override suspend fun onConfigManagerReady (configManager : ConfigManager ) {
2123 val pluginConfigManager = PluginConfigManager (
2224 databasePlugin,
You can’t perform that action at this time.
0 commit comments