public static class VirtualMachine.ForHotSpot extends VirtualMachine.AbstractBase
Modifier and Type | Class and Description |
---|---|
static interface |
VirtualMachine.ForHotSpot.Connection
Represents a connection to a virtual machine.
|
VirtualMachine.AbstractBase, 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.
|
Properties |
getAgentProperties()
Loads the target VMs agent properties.
|
Properties |
getSystemProperties()
Loads the target VMs system properties.
|
protected void |
load(String file,
boolean absolute,
String argument)
Loads an agent by the given command.
|
void |
loadAgent(String jarFile,
String argument)
Loads an agent into the represented virtual machine.
|
void |
loadAgentLibrary(String library,
String argument)
Loads a native agent library into the represented virtual machine.
|
void |
loadAgentPath(String path,
String argument)
Loads a native agent into the represented virtual machine.
|
String |
startLocalManagementAgent()
Starts a local management agent.
|
void |
startManagementAgent(Properties properties)
Starts a JMX management agent.
|
loadAgent, loadAgentLibrary, loadAgentPath
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 Properties getSystemProperties() throws IOException
IOException
- If an I/O exception occurs.public Properties getAgentProperties() throws IOException
IOException
- If an I/O exception occurs.public void loadAgent(String jarFile, String argument) throws IOException
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 path, String argument) throws IOException
path
- The agent path.argument
- The argument to provide or null
if no argument should be provided.IOException
- If an I/O exception occurs.public void loadAgentLibrary(String library, String argument) throws IOException
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 absolute, String argument) throws IOException
file
- The Java agent or library to be loaded.absolute
- true
if the agent location is absolute.argument
- The argument to the agent or null
if no argument is given.IOException
- If an I/O exception occurs.public void startManagementAgent(Properties properties) throws IOException
properties
- The properties to transfer to the JMX agent.IOException
- If an I/O error occurs.public String startLocalManagementAgent() throws IOException
IOException
- If an I/O error occurs.public void detach() throws IOException
IOException
- If an I/O exception occurs.Copyright © 2014–2021. All rights reserved.