public class BootstrapLoader
extends java.lang.Object
Warning to maintainers: even slight changes to the code in this class can cause subtle failures at Agent startup time. The methods in this class modify the bootstrap classpath. Any change that causes bootstrap classes to be loaded before the bootstrap classpath changes are complete will result in said classes being loaded by the "wrong" classloader, potentially causing peculiar consequences later in execution. The existing dependencies (AgentJarHelper, JarResource, asm.ClassStructure) have been checked and don't result in undesirable classes being pulled into the "wrong" loader. Changes to dependencies must be understood and tested carefully. Dependencies on java.* are "safe". But in particular, do not introduce a dependency on the Logger here (it doesn't help anything, anyway, because the Logger has not been configured at this point in Agent startup).
| Modifier and Type | Field and Description |
|---|---|
static java.lang.String |
AGENT_BRIDGE_DATASTORE_JAR_NAME |
static java.lang.String |
AGENT_BRIDGE_JAR_NAME |
static java.lang.String |
API_JAR_NAME |
static java.lang.String |
WEAVER_API_JAR_NAME |
| Constructor and Description |
|---|
BootstrapLoader() |
| Modifier and Type | Method and Description |
|---|---|
static void |
forceCorrectNewRelicApi(java.lang.instrument.Instrumentation instrProxy)
This forces the correct NewRelic api implementation to load by getting the implementation class bytes out of the
agent bridge jar and hooking up a class transformer to always load those bytes for our api class.
|
static java.net.URL |
getDatastoreJarURL() |
static java.util.Collection<java.net.URL> |
getJarURLs()
Returns URLs for the jars contained within the agent jar.
|
static java.io.File |
getTempDir()
Returns the tempdir that the agent should use, or null if the default temp directory should
be used.
|
public static final java.lang.String AGENT_BRIDGE_JAR_NAME
public static final java.lang.String AGENT_BRIDGE_DATASTORE_JAR_NAME
public static final java.lang.String API_JAR_NAME
public static final java.lang.String WEAVER_API_JAR_NAME
public static void forceCorrectNewRelicApi(java.lang.instrument.Instrumentation instrProxy)
throws java.io.IOException
java.io.IOExceptionpublic static java.net.URL getDatastoreJarURL()
throws java.lang.ClassNotFoundException,
java.io.IOException
java.lang.ClassNotFoundExceptionjava.io.IOExceptionpublic static java.util.Collection<java.net.URL> getJarURLs()
throws java.lang.ClassNotFoundException,
java.io.IOException
java.lang.ClassNotFoundExceptionjava.io.IOExceptionpublic static java.io.File getTempDir()