Class AgentCachingPoolStrategy

java.lang.Object
io.opentelemetry.javaagent.tooling.muzzle.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 Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    io.opentelemetry.javaagent.tooling.muzzle.AgentCachingPoolStrategy.AgentTypePool
    typePool(net.bytebuddy.dynamic.ClassFileLocator classFileLocator, ClassLoader classLoader)
     
    io.opentelemetry.javaagent.tooling.muzzle.AgentCachingPoolStrategy.AgentTypePool
    typePool(net.bytebuddy.dynamic.ClassFileLocator classFileLocator, ClassLoader classLoader, String name)
     

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

  • Method Details

    • typePool

      public io.opentelemetry.javaagent.tooling.muzzle.AgentCachingPoolStrategy.AgentTypePool typePool(net.bytebuddy.dynamic.ClassFileLocator classFileLocator, ClassLoader classLoader)
      Specified by:
      typePool in interface net.bytebuddy.agent.builder.AgentBuilder.PoolStrategy
    • typePool

      public io.opentelemetry.javaagent.tooling.muzzle.AgentCachingPoolStrategy.AgentTypePool typePool(net.bytebuddy.dynamic.ClassFileLocator classFileLocator, ClassLoader classLoader, String name)
      Specified by:
      typePool in interface net.bytebuddy.agent.builder.AgentBuilder.PoolStrategy