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:
java.io.Closeable,java.lang.AutoCloseable,VirtualMachine.ForHotSpot.Connection
- Direct Known Subclasses:
VirtualMachine.ForHotSpot.Connection.ForJnaPosixSocket
- Enclosing interface:
- VirtualMachine.ForHotSpot.Connection
public abstract static class VirtualMachine.ForHotSpot.Connection.OnPersistentByteChannel<T> extends java.lang.Object implements VirtualMachine.ForHotSpot.Connection
A connection that is represented by a byte channel that is persistent during communication.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description private classVirtualMachine.ForHotSpot.Connection.OnPersistentByteChannel.ResponseA 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.ForJnaPosixSocket, VirtualMachine.ForHotSpot.Connection.ForJnaSolarisDoor, VirtualMachine.ForHotSpot.Connection.ForJnaWindowsNamedPipe, VirtualMachine.ForHotSpot.Connection.OnPersistentByteChannel<T>
-
-
Field Summary
Fields Modifier and Type Field Description private static byte[]BLANKA blank line argument.
-
Constructor Summary
Constructors Constructor Description OnPersistentByteChannel()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected abstract voidclose(T connection)Closes the connection to the target VM.protected abstract Tconnect()Creates a new connection to the target VM.VirtualMachine.ForHotSpot.Connection.Responseexecute(java.lang.String protocol, java.lang.String... argument)Executes a command on the current connection.protected abstract intread(T connection, byte[] buffer)Reads from the target VM.protected abstract voidwrite(T connection, byte[] buffer)Writes to the target VM.
-
-
-
Method Detail
-
execute
public VirtualMachine.ForHotSpot.Connection.Response execute(java.lang.String protocol, java.lang.String... argument) throws java.io.IOException
Executes a command on the current connection.- Specified by:
executein 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:
java.io.IOException- If an I/O error occurred.
-
connect
protected abstract T connect() throws java.io.IOException
Creates a new connection to the target VM.- Returns:
- Returns a new connection to the target VM.
- Throws:
java.io.IOException- If an I/O exception occurs.
-
close
protected abstract void close(T connection) throws java.io.IOException
Closes the connection to the target VM.- Parameters:
connection- The connection to close.- Throws:
java.io.IOException- If an I/O exception occurs.
-
write
protected abstract void write(T connection, byte[] buffer) throws java.io.IOException
Writes to the target VM.- Parameters:
connection- The connection to write to.buffer- The buffer to write to.- Throws:
java.io.IOException- If an I/O exception occurs during writing.
-
read
protected abstract int read(T connection, byte[] buffer) throws java.io.IOException
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:
java.io.IOException- If an I/O exception occurs.
-
-