public abstract static class VirtualMachine.ForHotSpot extends java.lang.Object implements VirtualMachine
VirtualMachine.ForHotSpot| Modifier and Type | Field and Description |
|---|---|
private static java.lang.String |
ARGUMENT_DELIMITER
A delimiter to be used for attachment.
|
private static byte[] |
BLANK
A blank line argument.
|
private static java.lang.String |
INSTRUMENT_COMMAND
The
instrument command. |
private static java.lang.String |
LOAD_COMMAND
The
load command. |
protected java.lang.String |
processId
The target process's id.
|
private static java.lang.String |
PROTOCOL_VERSION
The protocol version to use for communication.
|
private static java.lang.String |
UTF_8
The UTF-8 charset name.
|
| Modifier | Constructor and Description |
|---|---|
protected |
ForHotSpot(java.lang.String processId)
Creates a new HotSpot-compatible VM implementation.
|
| Modifier and Type | Method and Description |
|---|---|
protected abstract void |
connect()
Connects to the target VM.
|
void |
loadAgent(java.lang.String jarFile,
java.lang.String argument)
Loads an agent into the represented virtual machine.
|
protected abstract int |
read(byte[] buffer)
Reads from the communication channel.
|
protected abstract void |
write(byte[] buffer)
Writes to the communication channel.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitdetachprivate static final java.lang.String UTF_8
private static final java.lang.String PROTOCOL_VERSION
private static final java.lang.String LOAD_COMMAND
load command.private static final java.lang.String INSTRUMENT_COMMAND
instrument command.private static final java.lang.String ARGUMENT_DELIMITER
private static final byte[] BLANK
protected final java.lang.String processId
protected ForHotSpot(java.lang.String processId)
processId - The target process's id.public void loadAgent(java.lang.String jarFile,
java.lang.String argument)
throws java.io.IOException
loadAgent in interface VirtualMachinejarFile - The jar file to attach.argument - The argument to provide or null if no argument should be provided.java.io.IOException - If an I/O exception occurs.protected abstract void connect()
throws java.io.IOException
java.io.IOException - If an I/O exception occurs.protected abstract int read(byte[] buffer)
throws java.io.IOException
buffer - The buffer to read into.java.io.IOException - If an I/O exception occurs.protected abstract void write(byte[] buffer)
throws java.io.IOException
buffer - The buffer to write from.java.io.IOException - If an I/O exception occurs.