public static class VirtualMachine.ForHotSpotVm extends Object implements VirtualMachine
Modifier and Type | Class and Description |
---|---|
static interface |
VirtualMachine.ForHotSpotVm.Connection
Represents a connection to a virtual machine.
|
VirtualMachine.ForHotSpotVm
Modifier | Constructor and Description |
---|---|
protected |
ForHotSpotVm(VirtualMachine.ForHotSpotVm.Connection connection)
Creates a default virtual machine implementation.
|
Modifier and Type | Method and Description |
---|---|
static Class<?> |
assertAvailability()
Asserts if this virtual machine type is available on the current VM.
|
static VirtualMachine |
attach(String processId)
Attaches to the supplied process id using the default JNA implementation.
|
static VirtualMachine |
attach(String processId,
VirtualMachine.ForHotSpotVm.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 ForHotSpotVm(VirtualMachine.ForHotSpotVm.Connection connection)
connection
- The virtual machine connection.public static Class<?> assertAvailability() throws Throwable
Throwable
- If this virtual machine is not available.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.ForHotSpotVm.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 VirtualMachine
jarFile
- 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 VirtualMachine
library
- 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 VirtualMachine
IOException
- If an I/O exception occurs.Copyright © 2014–2019. All rights reserved.