ApplicationContextHolderStrategy

Functions

Link copied to clipboard
abstract fun clearContext(name: String): ApplicationContext?

Clear context for given name and return back the context

Link copied to clipboard
abstract fun existsContext(name: String, permittedKeys: Set<Key<*>>?): Boolean

Check if context with given name and permittedKeys exists in this context holder strategy

Link copied to clipboard
abstract fun getContext(name: String): ApplicationContext?

Get a context for given name. If not available then create one, set in holder and return back.

abstract fun getContext(name: String, permittedKeys: Set<Key<*>>?): ApplicationContext?

Same as getContext but with permittedKeys. If context already exist with different set of keys then this method should throw InvalidKeyException

Link copied to clipboard
abstract suspend fun initCoroutineScope(coroutineScope: CoroutineScope? = null): CoroutineScope

Initialize a new CoroutineScope which can hold ApplicationContext for all coroutines that use this scope

Link copied to clipboard
abstract fun setContext(applicationContext: ApplicationContext)

Set any externally created context into the context holder strategy. If any context with this name already exist then this method should throw InvalidContextException

Link copied to clipboard

Get type of context supported by this holder strategy