register

abstract fun register(service: Any, serviceName: String = service.javaClass.toName(), serviceType: KType = service.javaClass.kotlin.defaultType)

Registers a service instance with the provider. The service can be registered with a custom name and type, or use defaults derived from the service instance.

Parameters

service

the service instance to register

serviceName

the name to register the service under (defaults to class name converted to naming convention)

serviceType

the Kotlin type of the service (defaults to the service's class default type)