Class IndyBootstrap
java.lang.Object
io.opentelemetry.javaagent.tooling.instrumentation.indy.IndyBootstrap
We instruct Byte Buddy (via
Advice.WithCustomMapping.bootstrap(java.lang.reflect.Method))
to dispatch non-inlined advices via an invokedynamic
(indy) instruction. The target method is linked to a dynamically created instrumentation module
class loader that is specific to an instrumentation module and the class loader of the
instrumented method.
The first invocation of an INVOKEDYNAMIC causes the JVM to dynamically link a CallSite. In this case, it will use the bootstrap(java.lang.invoke.MethodHandles.Lookup, java.lang.String, java.lang.invoke.MethodType, java.lang.Object[]) method to do that. This will also
create the InstrumentationModuleClassLoader.
Bootstrap CL ←──────────────────────────── Agent CL
↑ └───────── IndyBootstrapDispatcher ─ ↑ ──→ └────────────── bootstrap(java.lang.invoke.MethodHandles.Lookup, java.lang.String, java.lang.invoke.MethodType, java.lang.Object[])
Ext/Platform CL ↑ │ ╷
↑ ╷ │ ↓
System CL ╷ │ IndyModuleRegistry.getInstrumentationClassLoader(String, ClassLoader)
↑ ╷ │ ╷
Common linking of CallSite │ ╷
↑ ↑ (on first invocation) │ ╷
WebApp1 WebApp2 ╷ │ creates
↑ - InstrumentedClass ╷ │ ╷
│ ╷ ╷ │ ╷
│ INVOKEDYNAMIC │ ↓
└────────────────┼──────────────────InstrumentationModuleClassLoader
└╶╶╶╶╶╶╶╶╶╶╶╶╶╶╶╶╶╶╶╶╶→├ AdviceClass
├ AdviceHelper
└ LookupExposer
Legend:
╶╶→ method calls
──→ class loader parent/child relationships
-
Method Summary
-
Method Details