Class DefaultStorageManager

java.lang.Object
io.smallrye.context.storage.impl.DefaultStorageManager
All Implemented Interfaces:
StorageManager

public class DefaultStorageManager extends Object implements StorageManager
Default implementation which allocates new regular ThreadLocal for any storage declaration class.
  • Constructor Details

    • DefaultStorageManager

      public DefaultStorageManager()
  • Method Details

    • getThreadLocal

      public <T extends StorageDeclaration<X>, X> ThreadLocal<X> getThreadLocal(Class<T> klass)
      Returns a regular ThreadLocal specific for the given storage declaration.
      Specified by:
      getThreadLocal in interface StorageManager
      Type Parameters:
      T - The StorageDeclaration type
      X - The type of data we store in that ThreadLocal
      Parameters:
      klass - the declaration class which defines the type of item we want to store in the required ThreadLocal
      Returns:
      the ThreadLocal, memoized