Class ThreadLocalContextHolderStrategy

    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
    • Field Summary

      Fields 
      Modifier and Type Field Description
    • Enum Constant Summary

      Enum Constants 
      Enum Constant Description
    • Method Summary

      Modifier and Type Method Description
      <T extends ApplicationContext> KClass<T> supportedApplicationContextType() Get type of context supported by this holder strategy
      CoroutineScope initCoroutineScope(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
    • Constructor Detail

      • ThreadLocalContextHolderStrategy

        ThreadLocalContextHolderStrategy()
    • Method Detail

      • 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