Class ByteBuddyAgent.AttachmentProvider.Accessor.Simple
java.lang.Object
net.bytebuddy.agent.ByteBuddyAgent.AttachmentProvider.Accessor.Simple
- All Implemented Interfaces:
ByteBuddyAgent.AttachmentProvider.Accessor
- Direct Known Subclasses:
ByteBuddyAgent.AttachmentProvider.Accessor.Simple.WithDirectAttachment, ByteBuddyAgent.AttachmentProvider.Accessor.Simple.WithExternalAttachment
- Enclosing interface:
ByteBuddyAgent.AttachmentProvider.Accessor
public abstract static class ByteBuddyAgent.AttachmentProvider.Accessor.Simple
extends Object
implements ByteBuddyAgent.AttachmentProvider.Accessor
A simple implementation of an accessible accessor.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprotected static classA simple implementation of an accessible accessor that attaches using a virtual machine emulation that does not require external attachment.protected static classA simple implementation of an accessible accessor that allows for external attachment.Nested classes/interfaces inherited from interface ByteBuddyAgent.AttachmentProvider.Accessor
ByteBuddyAgent.AttachmentProvider.Accessor.ExternalAttachment, ByteBuddyAgent.AttachmentProvider.Accessor.Simple, ByteBuddyAgent.AttachmentProvider.Accessor.Unavailable -
Field Summary
FieldsFields inherited from interface ByteBuddyAgent.AttachmentProvider.Accessor
VIRTUAL_MACHINE_TYPE_NAME, VIRTUAL_MACHINE_TYPE_NAME_J9 -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionClass<?> Returns aVirtualMachineclass.booleanDetermines if this accessor is applicable for the currently running JVM.of(ClassLoader classLoader, File... classPath) Creates an accessor by reading the process id from the JMX runtime bean and by attempting to load thecom.sun.tools.attach.VirtualMachineclass from the provided class loader.ofJ9()Creates an accessor by reading the process id from the JMX runtime bean and by attempting to load thecom.ibm.tools.attach.VirtualMachineclass from the provided class loader.Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface ByteBuddyAgent.AttachmentProvider.Accessor
getExternalAttachment, isExternalAttachmentRequired
-
Field Details
-
virtualMachineType
AVirtualMachineclass.
-
-
Constructor Details
-
Simple
Creates a new simple accessor.- Parameters:
virtualMachineType- AVirtualMachineclass.
-
-
Method Details
-
of
public static ByteBuddyAgent.AttachmentProvider.Accessor of(@MaybeNull ClassLoader classLoader, File... classPath) Creates an accessor by reading the process id from the JMX runtime bean and by attempting to load the
com.sun.tools.attach.VirtualMachineclass from the provided class loader.This accessor is supposed to work on any implementation of the OpenJDK or Oracle JDK.
- Parameters:
classLoader- A class loader that is capable of loading the virtual machine type.classPath- The class path required to load the virtual machine class.- Returns:
- An appropriate accessor.
-
ofJ9
Creates an accessor by reading the process id from the JMX runtime bean and by attempting to load the
com.ibm.tools.attach.VirtualMachineclass from the provided class loader.This accessor is supposed to work on any implementation of IBM's J9.
- Returns:
- An appropriate accessor.
-
isAvailable
public boolean isAvailable()Determines if this accessor is applicable for the currently running JVM.- Specified by:
isAvailablein interfaceByteBuddyAgent.AttachmentProvider.Accessor- Returns:
trueif this accessor is available.
-
getVirtualMachineType
Returns aVirtualMachineclass. This method must only be called for available accessors.- Specified by:
getVirtualMachineTypein interfaceByteBuddyAgent.AttachmentProvider.Accessor- Returns:
- The virtual machine type.
-