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 classVirtualMachine.ForHotSpot.Connection.ForJnaPosixSocket.FactoryA factory for a POSIX socket connection to a JVM using JNA.protected static interfaceVirtualMachine.ForHotSpot.Connection.ForJnaPosixSocket.PosixLibraryA 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.PosixLibrarylibraryThe JNA library to use.private java.io.FilesocketThe POSIX socket.
-
Constructor Summary
Constructors Modifier Constructor Description protectedForJnaPosixSocket(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 voidclose()protected voidclose(java.lang.Integer handle)Closes the connection to the target VM.protected java.lang.Integerconnect()Creates a new connection to the target VM.protected intread(java.lang.Integer handle, byte[] buffer)Reads from the target VM.protected voidwrite(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.OnPersistentByteChannelCreates a new connection to the target VM.- Specified by:
connectin 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.OnPersistentByteChannelReads from the target VM.- Specified by:
readin 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.OnPersistentByteChannelWrites to the target VM.- Specified by:
writein 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.OnPersistentByteChannelCloses the connection to the target VM.- Specified by:
closein classVirtualMachine.ForHotSpot.Connection.OnPersistentByteChannel<java.lang.Integer>- Parameters:
handle- The connection to close.
-
close
public void close()
-
-