Class InstrumentationModuleClassLoader
java.lang.Object
java.lang.ClassLoader
io.opentelemetry.javaagent.tooling.instrumentation.indy.InstrumentationModuleClassLoader
Class loader used to load the helper classes from
InstrumentationModules, so that those
classes have access to both the agent/extension classes and the instrumented application classes.
This class loader implements the following classloading delegation strategy:
- First, injected classes are considered (usually the helper classes from the InstrumentationModule)
- Next, the class loader looks in the agent or extension class loader, depending on where the InstrumentationModule comes from
- Finally, the instrumented application class loader is checked for the class
In addition, this class loader ensures that the lookup of corresponding .class resources follow the same delegation strategy, so that bytecode inspection tools work correctly.
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionInstrumentationModuleClassLoader(ClassLoader instrumentedCl, ClassLoader agentOrExtensionCl) -
Method Summary
Modifier and TypeMethodDescriptionProvides a Lookup within this class loader.getResource(String resourceName) getResources(String resourceName) booleanhasModuleInstalled(io.opentelemetry.javaagent.extension.instrumentation.InstrumentationModule module) voidinstallModule(io.opentelemetry.javaagent.extension.instrumentation.InstrumentationModule module) Class<?> protected Class<?> Methods inherited from class java.lang.ClassLoader
clearAssertionStatus, defineClass, defineClass, defineClass, defineClass, definePackage, findClass, findClass, findLibrary, findLoadedClass, findResource, findResource, findResources, findSystemClass, getClassLoadingLock, getDefinedPackage, getDefinedPackages, getName, getPackage, getPackages, getParent, getPlatformClassLoader, getResourceAsStream, getSystemClassLoader, getSystemResource, getSystemResourceAsStream, getSystemResources, getUnnamedModule, isRegisteredAsParallelCapable, registerAsParallelCapable, resolveClass, resources, setClassAssertionStatus, setDefaultAssertionStatus, setPackageAssertionStatus, setSigners
-
Field Details
-
bytecodeOverride
-
-
Constructor Details
-
InstrumentationModuleClassLoader
-
-
Method Details
-
getLookup
Provides a Lookup within this class loader. SeeLookupExposerfor the details.- Returns:
- a lookup capable of accessing public types in this class loader
-
installModule
public void installModule(io.opentelemetry.javaagent.extension.instrumentation.InstrumentationModule module) -
hasModuleInstalled
public boolean hasModuleInstalled(io.opentelemetry.javaagent.extension.instrumentation.InstrumentationModule module) -
loadClass
- Overrides:
loadClassin classClassLoader- Throws:
ClassNotFoundException
-
loadClass
- Overrides:
loadClassin classClassLoader- Throws:
ClassNotFoundException
-
getResource
- Overrides:
getResourcein classClassLoader
-
getResources
- Overrides:
getResourcesin classClassLoader- Throws:
IOException
-