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

jvmMain.assembly.RaptorServiceRegistration.kt Maven / Gradle / Ivy

There is a newer version: 0.27.0
Show newest version
package io.fluidsonic.raptor.lifecycle

import io.fluidsonic.raptor.*
import io.fluidsonic.raptor.di.*


internal class RaptorServiceRegistration(
	val factory: RaptorDI.() -> Service,
	val name: String,
	private val providedKeys: List>,
) : RaptorComponent.Base>(RaptorLifecyclePlugin) {

	val diKey = ServiceDIKey(name)


	fun install(di: RaptorDIComponent<*>) {
		val diKey = diKey
		di.provide(diKey, factory)

		for (key in providedKeys)
			di.provide(key) { get(diKey) }
	}
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy