koin-core / org.koin.core.instance / DefinitionInstance

DefinitionInstance

abstract class DefinitionInstance<T>

Koin Instance Holder create/get/release an instance of given definition

Constructors

<init>

DefinitionInstance(beanDefinition: BeanDefinition<T>)

Koin Instance Holder create/get/release an instance of given definition

Properties

beanDefinition

val beanDefinition: BeanDefinition<T>

Functions

close

abstract fun close(): Unit

close the instance allocation from registry

create

open fun <T> create(context: InstanceContext): T

Create an instance

get

abstract fun <T> get(context: InstanceContext): T

Retrieve an instance

isCreated

abstract fun isCreated(context: InstanceContext): Boolean

Is instance created

release

abstract fun release(context: InstanceContext): Unit

Release the held instance (if hold)

Companion Object Properties

ERROR_SEPARATOR

const val ERROR_SEPARATOR: String

Inheritors

FactoryDefinitionInstance

class FactoryDefinitionInstance<T> : DefinitionInstance<T>

Factory Instance Holder

ScopeDefinitionInstance

class ScopeDefinitionInstance<T> : DefinitionInstance<T>

Scope definition Instance holder

SingleDefinitionInstance

class SingleDefinitionInstance<T> : DefinitionInstance<T>

Single instance holder