Top Description Inners Methods
net.bytebuddy.agent

public Interface VirtualMachine

Known Direct Implementers
net.bytebuddy.agent.VirtualMachine.AbstractBase
Imports
com.sun.jna.*, com.sun.jna.platform.win32.*, com.sun.jna.ptr.IntByReference, com.sun.jna.win32.StdCallLibrary, .W32APIOptions, edu.umd.cs.findbugs.annotations.SuppressFBWarnings, net.bytebuddy.agent.utility.nullability.MaybeNull, .UnknownNull, java.io.*, java.net.ServerSocket, .Socket, java.nio.ByteBuffer, java.nio.channels.FileLock, java.security.PrivilegedAction, .SecureRandom, java.util.*, java.util.concurrent.TimeUnit

An implementation for attachment on a virtual machine. This interface mimics the tooling API's virtual machine interface to allow for similar usage by ByteBuddyAgent where all calls are made via reflection such that this structural typing suffices for interoperability.

Note

Implementations are required to declare a static method attach(String) returning an instance of a class that declares the methods defined by VirtualMachine.

Nested and Inner Type Summary

Modifier and TypeClass and Description
public abstract static class
VirtualMachine.AbstractBase

An abstract base implementation for a virtual machine.

public static class
VirtualMachine.ForHotSpot

A virtual machine attachment implementation for a HotSpot VM or any compatible JVM.

public static class
VirtualMachine.ForOpenJ9

A virtual machine attachment implementation for OpenJ9 or any compatible JVM.

public static enum
VirtualMachine.Resolver

A resolver for the current VM's virtual machine attachment emulation.

Method Summary

Modifier and TypeMethod and Description
public void
detach()

Detaches this virtual machine representation.

public Properties

Returns:

The target VM properties.
getAgentProperties
()

Loads the target VMs agent properties.

public Properties

Returns:

The target VM properties.
getSystemProperties
()

Loads the target VMs system properties.

public void
loadAgent(String
The jar file to attach.
jarFile
)

Loads an agent into the represented virtual machine.

public void
loadAgent(String
The jar file to attach.
jarFile
,
String
The argument to provide or null if no argument should be provided.
argument
)

Loads an agent into the represented virtual machine.

public void
loadAgentLibrary(String
The agent library.
library
)

Loads a native agent library into the represented virtual machine.

public void
loadAgentLibrary(String
The agent library.
library
,
String
The argument to provide or null if no argument should be provided.
argument
)

Loads a native agent library into the represented virtual machine.

public void
loadAgentPath(String
The agent path.
path
)

Loads a native agent into the represented virtual machine.

public void
loadAgentPath(String
The agent path.
path
,
String
The argument to provide or null if no argument should be provided.
argument
)

Loads a native agent into the represented virtual machine.

public String

Returns:

The local connector address.
startLocalManagementAgent
()

Starts a local management agent.

public void
startManagementAgent(Properties
The properties to transfer to the JMX agent.
properties
)

Starts a JMX management agent.