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 java.lang.Object implements ByteBuddyAgent.AttachmentProvider.Accessor
A simple implementation of an accessible accessor.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description protected static classByteBuddyAgent.AttachmentProvider.Accessor.Simple.WithDirectAttachmentA simple implementation of an accessible accessor that attaches using a virtual machine emulation that does not require external attachment.protected static classByteBuddyAgent.AttachmentProvider.Accessor.Simple.WithExternalAttachmentA 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
Fields Modifier and Type Field Description protected java.lang.Class<?>virtualMachineTypeAVirtualMachineclass.-
Fields inherited from interface net.bytebuddy.agent.ByteBuddyAgent.AttachmentProvider.Accessor
VIRTUAL_MACHINE_TYPE_NAME, VIRTUAL_MACHINE_TYPE_NAME_J9
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedSimple(java.lang.Class<?> virtualMachineType)Creates a new simple accessor.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.Class<?>getVirtualMachineType()Returns aVirtualMachineclass.booleanisAvailable()Determines if this accessor is applicable for the currently running JVM.static ByteBuddyAgent.AttachmentProvider.Accessorof(java.lang.ClassLoader classLoader, java.io.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.static ByteBuddyAgent.AttachmentProvider.AccessorofJ9()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 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
-
-
-
-
Method Detail
-
of
public static ByteBuddyAgent.AttachmentProvider.Accessor of(java.lang.ClassLoader classLoader, java.io.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
public static ByteBuddyAgent.AttachmentProvider.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
public java.lang.Class<?> getVirtualMachineType()
Returns aVirtualMachineclass. This method must only be called for available accessors.- Specified by:
getVirtualMachineTypein interfaceByteBuddyAgent.AttachmentProvider.Accessor- Returns:
- The virtual machine type.
-
-