Package net.bytebuddy.agent
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 class
A simple implementation of an accessible accessor that attaches using a virtual machine emulation that does not require external attachment.protected static class
A simple implementation of an accessible accessor that allows for external attachment.Nested classes/interfaces inherited from interface net.bytebuddy.agent.ByteBuddyAgent.AttachmentProvider.Accessor
ByteBuddyAgent.AttachmentProvider.Accessor.ExternalAttachment, ByteBuddyAgent.AttachmentProvider.Accessor.Simple, ByteBuddyAgent.AttachmentProvider.Accessor.Unavailable
-
Field Summary
FieldsFields inherited from interface net.bytebuddy.agent.ByteBuddyAgent.AttachmentProvider.Accessor
VIRTUAL_MACHINE_TYPE_NAME, VIRTUAL_MACHINE_TYPE_NAME_J9
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionClass
<?> Returns aVirtualMachine
class.boolean
Determines 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.VirtualMachine
class 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.VirtualMachine
class from the provided class loader.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface net.bytebuddy.agent.ByteBuddyAgent.AttachmentProvider.Accessor
getExternalAttachment, isExternalAttachmentRequired
-
Field Details
-
virtualMachineType
AVirtualMachine
class.
-
-
Constructor Details
-
Simple
Creates a new simple accessor.- Parameters:
virtualMachineType
- AVirtualMachine
class.
-
-
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.VirtualMachine
class 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.VirtualMachine
class 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:
isAvailable
in interfaceByteBuddyAgent.AttachmentProvider.Accessor
- Returns:
true
if this accessor is available.
-
getVirtualMachineType
Returns aVirtualMachine
class. This method must only be called for available accessors.- Specified by:
getVirtualMachineType
in interfaceByteBuddyAgent.AttachmentProvider.Accessor
- Returns:
- The virtual machine type.
-