Class AgentCachingPoolStrategy

  • All Implemented Interfaces:
    net.bytebuddy.agent.builder.AgentBuilder.PoolStrategy

    public class AgentCachingPoolStrategy
    extends Object
    implements net.bytebuddy.agent.builder.AgentBuilder.PoolStrategy
      There two core parts to the cache...
    • a cache of ClassLoader to WeakReference<ClassLoader>
    • a single cache of TypeResolutions for all ClassLoaders - keyed by a custom composite key of ClassLoader and class name

    This design was chosen to create a single limited size cache that can be adjusted for the entire application -- without having to create a large number of WeakReference objects.

    Eviction is handled through a size restriction

    • Nested Class Summary

      • Nested classes/interfaces inherited from interface net.bytebuddy.agent.builder.AgentBuilder.PoolStrategy

        net.bytebuddy.agent.builder.AgentBuilder.PoolStrategy.ClassLoading, net.bytebuddy.agent.builder.AgentBuilder.PoolStrategy.Default, net.bytebuddy.agent.builder.AgentBuilder.PoolStrategy.Eager, net.bytebuddy.agent.builder.AgentBuilder.PoolStrategy.WithTypePoolCache
    • Constructor Detail

      • AgentCachingPoolStrategy

        public AgentCachingPoolStrategy()
    • Method Detail

      • typePool

        public final net.bytebuddy.pool.TypePool typePool​(net.bytebuddy.dynamic.ClassFileLocator classFileLocator,
                                                          ClassLoader classLoader)
        Specified by:
        typePool in interface net.bytebuddy.agent.builder.AgentBuilder.PoolStrategy
      • typePool

        public final net.bytebuddy.pool.TypePool typePool​(net.bytebuddy.dynamic.ClassFileLocator classFileLocator,
                                                          ClassLoader classLoader,
                                                          String name)
        Specified by:
        typePool in interface net.bytebuddy.agent.builder.AgentBuilder.PoolStrategy