Package net.bytebuddy.agent
Class VirtualMachine.ForHotSpot.Connection.OnPersistentByteChannel<T>
java.lang.Object
net.bytebuddy.agent.VirtualMachine.ForHotSpot.Connection.OnPersistentByteChannel<T>
- Type Parameters:
T
- The connection representation.
- All Implemented Interfaces:
Closeable
,AutoCloseable
,VirtualMachine.ForHotSpot.Connection
- Enclosing interface:
VirtualMachine.ForHotSpot.Connection
public abstract static class VirtualMachine.ForHotSpot.Connection.OnPersistentByteChannel<T>
extends Object
implements VirtualMachine.ForHotSpot.Connection
A connection that is represented by a byte channel that is persistent during communication.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprivate class
A response of a persistent byte channel.Nested classes/interfaces inherited from interface net.bytebuddy.agent.VirtualMachine.ForHotSpot.Connection
VirtualMachine.ForHotSpot.Connection.Factory, VirtualMachine.ForHotSpot.Connection.OnPersistentByteChannel<T>
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected abstract void
Closes the connection to the target VM.protected abstract T
connect()
Creates a new connection to the target VM.Executes a command on the current connection.protected abstract int
Reads from the target VM.protected abstract void
Writes to the target VM.
-
Field Details
-
BLANK
private static final byte[] BLANKA blank line argument.
-
-
Constructor Details
-
OnPersistentByteChannel
public OnPersistentByteChannel()
-
-
Method Details
-
execute
public VirtualMachine.ForHotSpot.Connection.Response execute(String protocol, String... argument) throws IOException Executes a command on the current connection.- Specified by:
execute
in interfaceVirtualMachine.ForHotSpot.Connection
- Parameters:
protocol
- The target VMs protocol version for the attach API.argument
- The arguments to send to the target VM.- Returns:
- The response of the target JVM.
- Throws:
IOException
- If an I/O error occurred.
-
connect
Creates a new connection to the target VM.- Returns:
- Returns a new connection to the target VM.
- Throws:
IOException
- If an I/O exception occurs.
-
close
Closes the connection to the target VM.- Parameters:
connection
- The connection to close.- Throws:
IOException
- If an I/O exception occurs.
-
write
Writes to the target VM.- Parameters:
connection
- The connection to write to.buffer
- The buffer to write to.- Throws:
IOException
- If an I/O exception occurs during writing.
-
read
Reads from the target VM.- Parameters:
connection
- The connection to read from.buffer
- The buffer to store the result in.- Returns:
- The number of byte that were read.
- Throws:
IOException
- If an I/O exception occurs.
-