Class AgentBuilder.PoolStrategy.WithTypePoolCache.Simple

    • Field Detail

      • BOOTSTRAP_MARKER

        private static final java.lang.ClassLoader BOOTSTRAP_MARKER
        A default value for marking the boostrap class loader.
      • cacheProviders

        private final java.util.concurrent.ConcurrentMap<? super java.lang.ClassLoader,​TypePool.CacheProvider> cacheProviders
        The concurrent map that is used for storing a cache provider per class loader.
    • Constructor Detail

      • Simple

        public Simple​(java.util.concurrent.ConcurrentMap<? super java.lang.ClassLoader,​TypePool.CacheProvider> cacheProviders)
        Creates a new type locator that caches a cache provider per class loader in a concurrent map. The type locator uses a fast TypePool.Default.ReaderMode.
        Parameters:
        cacheProviders - The concurrent map that is used for storing a cache provider per class loader.
      • Simple

        public Simple​(TypePool.Default.ReaderMode readerMode,
                      java.util.concurrent.ConcurrentMap<? super java.lang.ClassLoader,​TypePool.CacheProvider> cacheProviders)
        Creates a new type locator that caches a cache provider per class loader in a concurrent map.
        Parameters:
        readerMode - The reader mode to use for parsing a class file.
        cacheProviders - The concurrent map that is used for storing a cache provider per class loader.
    • Method Detail

      • doPrivileged

        @Enhance
        private static <T> T doPrivileged​(java.security.PrivilegedAction<T> action)
        A proxy for java.security.AccessController#doPrivileged that is activated if available.
        Type Parameters:
        T - The type of the action's resolved value.
        Parameters:
        action - The action to execute from a privileged context.
        Returns:
        The action's resolved value.
      • getBootstrapMarkerLoader

        protected java.lang.ClassLoader getBootstrapMarkerLoader()

        Returns the class loader to serve as a cache key if a cache provider for the bootstrap class loader is requested. This class loader is represented by null in the JVM which is an invalid value for many ConcurrentMap implementations.

        By default, a custom class loader is created to use as a marker.

        Returns:
        A class loader to represent the bootstrap class loader.