public static class VirtualMachine.ForHotSpot extends Object implements VirtualMachine
| Modifier and Type | Class and Description |
|---|---|
static interface |
VirtualMachine.ForHotSpot.Connection
Represents a connection to a virtual machine.
|
VirtualMachine.ForHotSpot, VirtualMachine.ForOpenJ9, VirtualMachine.Resolver| Modifier | Constructor and Description |
|---|---|
protected |
ForHotSpot(VirtualMachine.ForHotSpot.Connection connection)
Creates a new virtual machine connection for HotSpot.
|
| Modifier and Type | Method and Description |
|---|---|
static VirtualMachine |
attach(String processId)
Attaches to the supplied process id using the default JNA implementation.
|
static VirtualMachine |
attach(String processId,
VirtualMachine.ForHotSpot.Connection.Factory connectionFactory)
Attaches to the supplied process id using the supplied connection factory.
|
void |
detach()
Detaches this virtual machine representation.
|
protected void |
load(String file,
boolean isNative,
String argument)
Loads an agent by the given command.
|
void |
loadAgent(String jarFile,
String argument)
Loads an agent into the represented virtual machine.
|
void |
loadAgentPath(String library,
String argument)
Loads a native agent into the represented virtual machine.
|
protected ForHotSpot(VirtualMachine.ForHotSpot.Connection connection)
connection - The virtual machine connection.public static VirtualMachine attach(String processId) throws IOException
processId - The process id.IOException - If an IO exception occurs during establishing the connection.public static VirtualMachine attach(String processId, VirtualMachine.ForHotSpot.Connection.Factory connectionFactory) throws IOException
processId - The process id.connectionFactory - The connection factory to use.IOException - If an IO exception occurs during establishing the connection.public void loadAgent(String jarFile, String argument) throws IOException
loadAgent in interface VirtualMachinejarFile - The jar file to attach.argument - The argument to provide or null if no argument should be provided.IOException - If an I/O exception occurs.public void loadAgentPath(String library, String argument) throws IOException
loadAgentPath in interface VirtualMachinelibrary - The agent library.argument - The argument to provide or null if no argument should be provided.IOException - If an I/O exception occurs.protected void load(String file, boolean isNative, String argument) throws IOException
file - The Java agent or library to be loaded.isNative - true if the agent is native.argument - The argument to the agent or null if no argument is given.IOException - If an I/O exception occurs.public void detach()
throws IOException
detach in interface VirtualMachineIOException - If an I/O exception occurs.Copyright © 2014–2019. All rights reserved.