ServiceProvider

interface ServiceProvider

Service providers create instances of services

Types

CreatedInstance
Link copied to clipboard
data class CreatedInstance(instance: Any, createdAt: Instant)
Tracks created service instancesinstance is the service instance that was create.
ForInstance
Link copied to clipboard
data class ForInstance : ServiceProvider
Provides an already existing object as a service
ForPrototype
Link copied to clipboard
data class ForPrototype : ServiceProvider
Provides a prototype serviceEach call to provide will create a new instance.
ForSingleton
Link copied to clipboard
data class ForSingleton : ServiceProvider
Provides a singleton service
Type
Link copied to clipboard
enum Type : Enum<ServiceProvider.Type>
Ways in which services are provided.

Functions

provide
Link copied to clipboard
abstract fun provide(context: InjectionContext): Any
Provides the service instance
validate
Link copied to clipboard
abstract fun validate(kontainer: Kontainer): List<String>
Validates that a service can be provided.

Properties

instances
Link copied to clipboard
abstract val instances: List<ServiceProvider.CreatedInstance>
A list of all instances created by the provider
type
Link copied to clipboard
abstract val type: ServiceProvider.Type
The type of the service that is created

Inheritors

ServiceProvider
Link copied to clipboard
ServiceProvider
Link copied to clipboard
ServiceProvider
Link copied to clipboard