Class ThreadLocalContextHolderStrategy
-
- All Implemented Interfaces:
-
io.github.funofprograming.context.ApplicationContextHolderStrategy
public final class ThreadLocalContextHolderStrategy extends AbstractApplicationContextHolderStrategy
-
-
Constructor Summary
Constructors Constructor Description ThreadLocalContextHolderStrategy()
-
Method Summary
Modifier and Type Method Description <T extends ApplicationContext> KClass<T>supportedApplicationContextType()Get type of context supported by this holder strategy CoroutineScopeinitCoroutineScope(CoroutineScope coroutineScope)Initialize a new CoroutineScope which can hold ApplicationContext for all coroutines that use this scope. -
Methods inherited from class io.github.funofprograming.context.impl.AbstractApplicationContextHolderStrategy
clearContext, existsContext, getContext, getContext, setContext -
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
-
Method Detail
-
supportedApplicationContextType
<T extends ApplicationContext> KClass<T> supportedApplicationContextType()
Get type of context supported by this holder strategy
- Returns:
- </T>
-
initCoroutineScope
CoroutineScope initCoroutineScope(CoroutineScope coroutineScope)
Initialize a new CoroutineScope which can hold ApplicationContext for all coroutines that use this scope.
This is inheritable meaning if passed coroutineScope is already initialized with this ThreadLocal then that coroutineScope is not changed and returned as is.
- Parameters:
coroutineScope- if any existing coroutineScope passed then a new coroutineScope is created from that param and init for holding ApplicationContext
-
-
-
-