Package com.newrelic.agent.bridge
The java agent is loaded on the system classloader, but it injects bytecode into numerous
classes loaded on various other classloaders. That injected bytecode needs to make calls
into the agent, but the classloader in which the bytecode is loaded often has no visibility to the
system classloader (and thus the agent's classes).
That's where the bridge comes in. The agent jar contains the agent-bridge jar and the public api jar, and
when the agent starts it appends both of these jars to the bootstrap classloader
(see
Instrumentation.appendToBootstrapClassLoaderSearch(java.util.jar.JarFile)).
Loading the
jars on the bootstrap classloader makes them visible to all classloaders. The interfaces defined in
this agent-bridge module are implemented in the main agent jar, and bytecode that we inject into classes
is able to invoke that agent implementation through these interfaces - they're the bridge allowing
our injected code to invoke agent methods loaded through an inaccessible classloader.-
Interface Summary Interface Description Agent The internal bridge version of the Agent API.AsyncApi CloudApi Internal Cloud API.CollectionFactory Allows instrumentation and bridge API implementations to use collections from third partly libraries without depending directly on them.CrossProcessState DistributedTracePayload Deprecated. Instead, use the Distributed Tracing APITransaction.insertDistributedTraceHeaders(Headers)to create a distributed tracing payload andTransaction.acceptDistributedTraceHeaders(TransportType, Headers)to link the services together.ExitTracer ExtensionHolder<T> A holder for Weaver extension classes.ExtensionHolderFactory Called by the agent's weaver extension class template to generate anExtensionHolder.Instrumentation JmxApi PrivateApi PublicApi The public api interface.StatusCodePolicy Token Deprecated. TracedActivity Deprecated. Do not use.TracedMethod The internal bridge version of TracedMethod.Transaction The internal bridge version of Transaction.WebResponse -
Class Summary Class Description AgentBridge This implementation ofCollectionFactorywill only be used if the agent-bridge is being used by an application and the agent is NOT being loaded.AgentBridge.TokenAndRefCount DefaultCollectionFactory This implementation ofCollectionFactorywill only be used if the agent-bridge is being used by an application and the agent is NOT being loaded.ExtensionHolderFactory.NoOpExtensionHolderFactory ManifestUtils NoOpAiMonitoring NoOpAsyncApi NoOpCloud NoOpConfig NoOpCrossProcessState NoOpDistributedTracePayload NoOpInstrumentation NoOpJmxApi NoOpMetricAggregator NoOpPrivateApi NoOpSegment NoOpToken NoOpTracedMethod NoOpTraceMetadata NoOpTransaction NoOpWebResponse -
Enum Summary Enum Description TransactionNamePriority This is the internal version of TransactionNamePriority.