Package net.bytebuddy.agent
Class VirtualMachine.ForHotSpot.Connection.ForJnaPosixSocket
- java.lang.Object
-
- net.bytebuddy.agent.VirtualMachine.ForHotSpot.Connection.OnPersistentByteChannel<java.lang.Integer>
-
- net.bytebuddy.agent.VirtualMachine.ForHotSpot.Connection.ForJnaPosixSocket
-
- All Implemented Interfaces:
java.io.Closeable
,java.lang.AutoCloseable
,VirtualMachine.ForHotSpot.Connection
- Enclosing interface:
- VirtualMachine.ForHotSpot.Connection
public static class VirtualMachine.ForHotSpot.Connection.ForJnaPosixSocket extends VirtualMachine.ForHotSpot.Connection.OnPersistentByteChannel<java.lang.Integer>
Implements a connection for a POSIX socket in JNA.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
VirtualMachine.ForHotSpot.Connection.ForJnaPosixSocket.Factory
A factory for a POSIX socket connection to a JVM using JNA.protected static interface
VirtualMachine.ForHotSpot.Connection.ForJnaPosixSocket.PosixLibrary
A JNA library binding for POSIX sockets.-
Nested classes/interfaces inherited from interface net.bytebuddy.agent.VirtualMachine.ForHotSpot.Connection
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 VirtualMachine.ForHotSpot.Connection.ForJnaPosixSocket.PosixLibrary
library
The JNA library to use.private java.io.File
socket
The POSIX socket.
-
Constructor Summary
Constructors Modifier Constructor Description protected
ForJnaPosixSocket(VirtualMachine.ForHotSpot.Connection.ForJnaPosixSocket.PosixLibrary library, java.io.File socket)
Creates a connection for a virtual POSIX socket implemented in JNA.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
close()
protected void
close(java.lang.Integer handle)
Closes the connection to the target VM.protected java.lang.Integer
connect()
Creates a new connection to the target VM.protected int
read(java.lang.Integer handle, byte[] buffer)
Reads from the target VM.protected void
write(java.lang.Integer handle, byte[] buffer)
Writes to the target VM.-
Methods inherited from class net.bytebuddy.agent.VirtualMachine.ForHotSpot.Connection.OnPersistentByteChannel
execute
-
-
-
-
Field Detail
-
library
private final VirtualMachine.ForHotSpot.Connection.ForJnaPosixSocket.PosixLibrary library
The JNA library to use.
-
socket
private final java.io.File socket
The POSIX socket.
-
-
Constructor Detail
-
ForJnaPosixSocket
protected ForJnaPosixSocket(VirtualMachine.ForHotSpot.Connection.ForJnaPosixSocket.PosixLibrary library, java.io.File socket)
Creates a connection for a virtual POSIX socket implemented in JNA.- Parameters:
library
- The JNA library to use.socket
- The POSIX socket.
-
-
Method Detail
-
connect
protected java.lang.Integer connect()
Description copied from class:VirtualMachine.ForHotSpot.Connection.OnPersistentByteChannel
Creates a new connection to the target VM.- Specified by:
connect
in classVirtualMachine.ForHotSpot.Connection.OnPersistentByteChannel<java.lang.Integer>
- Returns:
- Returns a new connection to the target VM.
-
read
protected int read(java.lang.Integer handle, byte[] buffer)
Description copied from class:VirtualMachine.ForHotSpot.Connection.OnPersistentByteChannel
Reads from the target VM.- Specified by:
read
in classVirtualMachine.ForHotSpot.Connection.OnPersistentByteChannel<java.lang.Integer>
- Parameters:
handle
- The connection to read from.buffer
- The buffer to store the result in.- Returns:
- The number of byte that were read.
-
write
protected void write(java.lang.Integer handle, byte[] buffer)
Description copied from class:VirtualMachine.ForHotSpot.Connection.OnPersistentByteChannel
Writes to the target VM.- Specified by:
write
in classVirtualMachine.ForHotSpot.Connection.OnPersistentByteChannel<java.lang.Integer>
- Parameters:
handle
- The connection to write to.buffer
- The buffer to write to.
-
close
protected void close(java.lang.Integer handle)
Description copied from class:VirtualMachine.ForHotSpot.Connection.OnPersistentByteChannel
Closes the connection to the target VM.- Specified by:
close
in classVirtualMachine.ForHotSpot.Connection.OnPersistentByteChannel<java.lang.Integer>
- Parameters:
handle
- The connection to close.
-
close
public void close()
-
-