Class AgentClassLoader
- java.lang.Object
-
- java.lang.ClassLoader
-
- java.security.SecureClassLoader
-
- java.net.URLClassLoader
-
- io.opentelemetry.javaagent.bootstrap.AgentClassLoader
-
- All Implemented Interfaces:
Closeable
,AutoCloseable
public class AgentClassLoader extends URLClassLoader
Classloader used to run the core agent.It is built around the concept of a jar inside another jar. This classloader loads the files of the internal jar to load classes and resources.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
AgentClassLoader.BootstrapClassLoaderProxy
A stand-in for the bootstrap classloader.
-
Constructor Summary
Constructors Constructor Description AgentClassLoader(URL bootstrapJarLocation, String internalJarFileName, ClassLoader parent)
Construct a new AgentClassLoader.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description AgentClassLoader.BootstrapClassLoaderProxy
getBootstrapProxy()
URL
getResource(String resourceName)
-
Methods inherited from class java.net.URLClassLoader
close, findResource, findResources, getResourceAsStream, getURLs, newInstance, newInstance
-
Methods inherited from class java.lang.ClassLoader
clearAssertionStatus, getDefinedPackage, getDefinedPackages, getName, getParent, getPlatformClassLoader, getResources, getSystemClassLoader, getSystemResource, getSystemResourceAsStream, getSystemResources, getUnnamedModule, isRegisteredAsParallelCapable, loadClass, resources, setClassAssertionStatus, setDefaultAssertionStatus, setPackageAssertionStatus
-
-
-
-
Constructor Detail
-
AgentClassLoader
public AgentClassLoader(URL bootstrapJarLocation, String internalJarFileName, ClassLoader parent)
Construct a new AgentClassLoader.- Parameters:
bootstrapJarLocation
- Used for resource lookups.internalJarFileName
- File name of the internal jarparent
- Classloader parent. Should null (bootstrap), or the platform classloader for java 9+.
-
-
Method Detail
-
getResource
public URL getResource(String resourceName)
- Overrides:
getResource
in classClassLoader
-
getBootstrapProxy
public AgentClassLoader.BootstrapClassLoaderProxy getBootstrapProxy()
-
-