mirror of
https://github.com/ethauvin/kobalt.git
synced 2025-04-26 08:27:12 -07:00
Better initialization.
This commit is contained in:
parent
42eb5a48d8
commit
7a2906409f
1 changed files with 3 additions and 9 deletions
|
@ -30,15 +30,9 @@ public class KobaltServer @Inject constructor(val args: Args) : Runnable, IComma
|
||||||
val pending = arrayListOf<String>()
|
val pending = arrayListOf<String>()
|
||||||
|
|
||||||
private val COMMAND_CLASSES = listOf(GetDependenciesCommand::class.java, PingCommand::class.java)
|
private val COMMAND_CLASSES = listOf(GetDependenciesCommand::class.java, PingCommand::class.java)
|
||||||
|
private val COMMANDS = mapOf(*(COMMAND_CLASSES.map { it ->
|
||||||
private val COMMANDS = hashMapOf<String, ICommand>()
|
Kobalt.INJECTOR.getInstance(it).let { Pair(it.name, it) }
|
||||||
|
}.toTypedArray()))
|
||||||
init {
|
|
||||||
COMMAND_CLASSES.forEach {
|
|
||||||
val c = Kobalt.INJECTOR.getInstance(it)
|
|
||||||
COMMANDS.put(c.name, c)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
override fun run() {
|
override fun run() {
|
||||||
val portNumber = args.port
|
val portNumber = args.port
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue