toothpick-runtime / toothpick / ScopeImpl

ScopeImpl

open class ScopeImpl : ScopeNode

{@inheritDoc}

A note on concurrency :

All operations on the scope itself are non thread-safe. They must be used via the Toothpick class or must be synchronized using the Toothpick class if used concurrently.

Constructors

<init>

ScopeImpl(name: Any)

Functions

getInstance

open fun <T : Any> getInstance(clazz: Class<T>): T
open fun <T : Any> getInstance(clazz: Class<T>, name: String): T

getLazy

open fun <T : Any> getLazy(clazz: Class<T>): Lazy<T>
open fun <T : Any> getLazy(clazz: Class<T>, name: String): Lazy<T>

getProvider

open fun <T : Any> getProvider(clazz: Class<T>): Provider<T>
open fun <T : Any> getProvider(clazz: Class<T>, name: String): Provider<T>

inject

open fun inject(obj: Any): Unit

installModules

open fun installModules(vararg modules: Module): Scope

installTestModules

open fun installTestModules(vararg modules: Module): Scope

openSubScope

open fun openSubScope(subScopeName: Any): Scope
open fun openSubScope(subScopeName: Any, scopeConfig: ScopeConfig): Scope

release

open fun release(): Unit

toString

open fun toString(): String

Inherited Functions

equals

open fun equals(other: Any?): Boolean

getName

open fun getName(): Any

getParentScope

open fun getParentScope(): ScopeNode
open fun <A : Annotation> getParentScope(scopeAnnotationClass: Class<A>): ScopeNode

getRootScope

open fun getRootScope(): ScopeNode

hashCode

open fun hashCode(): Int

isScopeAnnotationSupported

open fun isScopeAnnotationSupported(scopeAnnotationClass: Class<out Annotation>): Boolean

supportScopeAnnotation

open fun supportScopeAnnotation(scopeAnnotationClass: Class<out Annotation>): Scope

Binds a scopeAnnotationClass, to the current scope. The current scope will accept all classes that are scoped using this scopeAnnotationClass.