Package co.elastic.apm.attach
Class CachedAttachmentProvider
- java.lang.Object
-
- co.elastic.apm.attach.CachedAttachmentProvider
-
- All Implemented Interfaces:
net.bytebuddy.agent.ByteBuddyAgent.AttachmentProvider
public class CachedAttachmentProvider extends java.lang.Object implements net.bytebuddy.agent.ByteBuddyAgent.AttachmentProvider
Successive attachments with atools.jar
-basedByteBuddyAgent.AttachmentProvider
would lead to theVirtualMachine
class to be loaded from multiple class loaders (seeByteBuddyAgent.AttachmentProvider.ForStandardToolsJarVm.attempt()
). That leads to a UnsatisfiedLinkError on Java 7 and 8 because the native library libattach can only be loaded by one class loader. By caching theByteBuddyAgent.AttachmentProvider.Accessor
, the same VirtualMachine class is reused so that there is no attempt to load the libattach library from another class loader.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface net.bytebuddy.agent.ByteBuddyAgent.AttachmentProvider
net.bytebuddy.agent.ByteBuddyAgent.AttachmentProvider.Accessor, net.bytebuddy.agent.ByteBuddyAgent.AttachmentProvider.Compound, net.bytebuddy.agent.ByteBuddyAgent.AttachmentProvider.ForEmulatedAttachment, net.bytebuddy.agent.ByteBuddyAgent.AttachmentProvider.ForJ9Vm, net.bytebuddy.agent.ByteBuddyAgent.AttachmentProvider.ForModularizedVm, net.bytebuddy.agent.ByteBuddyAgent.AttachmentProvider.ForStandardToolsJarVm, net.bytebuddy.agent.ByteBuddyAgent.AttachmentProvider.ForUserDefinedToolsJar
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description net.bytebuddy.agent.ByteBuddyAgent.AttachmentProvider.Accessor
attempt()
-