public static class VirtualMachine.ForHotSpot.OnUnix extends VirtualMachine.ForHotSpot
VirtualMachine.ForHotSpot.OnUnix
VirtualMachine.ForHotSpot
processId
Constructor and Description |
---|
OnUnix(String processId,
Object socket,
int attempts,
long pause,
long timeout,
TimeUnit timeUnit)
Creates a new VM implementation for a HotSpot VM running on Unix.
|
Modifier and Type | Method and Description |
---|---|
static Class<?> |
assertAvailability()
Asserts the availability of this virtual machine implementation.
|
static VirtualMachine |
attach(String processId)
Attaches to the supplied VM process.
|
protected void |
connect()
Connects to the target VM.
|
void |
detach()
Detaches this virtual machine representation.
|
int |
read(byte[] buffer)
Reads from the communication channel.
|
String |
toString() |
void |
write(byte[] buffer)
Writes to the communication channel.
|
loadAgent
public OnUnix(String processId, Object socket, int attempts, long pause, long timeout, TimeUnit timeUnit)
processId
- The process id of the target VM.socket
- The Unix socket to use for communication.attempts
- The number of attempts to connect.pause
- The pause time between two VMs.timeout
- The socket timeout.timeUnit
- The time unit of the pause time.public static Class<?> assertAvailability() throws Throwable
Throwable
is thrown.Throwable
- If this VM does not support POSIX sockets or is not running on a HotSpot VM.public static VirtualMachine attach(String processId) throws IOException
processId
- The process id of the target VM.IOException
- If an I/O exception occurs.protected void connect() throws IOException
VirtualMachine.ForHotSpot
connect
in class VirtualMachine.ForHotSpot
IOException
- If an I/O exception occurs.public int read(byte[] buffer) throws IOException
VirtualMachine.ForHotSpot
read
in class VirtualMachine.ForHotSpot
buffer
- The buffer to read into.IOException
- If an I/O exception occurs.public void write(byte[] buffer) throws IOException
VirtualMachine.ForHotSpot
write
in class VirtualMachine.ForHotSpot
buffer
- The buffer to write from.IOException
- If an I/O exception occurs.public void detach() throws IOException
VirtualMachine
IOException
- If an I/O exception occurs.Copyright © 2014–2016. All rights reserved.