Package net.bytebuddy.agent
Class VirtualMachine.ForHotSpot.Connection.ForJnaPosixSocket
- java.lang.Object
-
- net.bytebuddy.agent.VirtualMachine.ForHotSpot.Connection.OnPersistentByteChannel<Integer>
-
- net.bytebuddy.agent.VirtualMachine.ForHotSpot.Connection.ForJnaPosixSocket
-
- All Implemented Interfaces:
Closeable,AutoCloseable,VirtualMachine.ForHotSpot.Connection
- Enclosing interface:
- VirtualMachine.ForHotSpot.Connection
public static class VirtualMachine.ForHotSpot.Connection.ForJnaPosixSocket extends VirtualMachine.ForHotSpot.Connection.OnPersistentByteChannel<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>
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedForJnaPosixSocket(VirtualMachine.ForHotSpot.Connection.ForJnaPosixSocket.PosixLibrary library, 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(Integer handle)Closes the connection to the target VM.protected Integerconnect()Creates a new connection to the target VM.protected intread(Integer handle, byte[] buffer)Reads from the target VM.protected voidwrite(Integer handle, byte[] buffer)Writes to the target VM.-
Methods inherited from class net.bytebuddy.agent.VirtualMachine.ForHotSpot.Connection.OnPersistentByteChannel
execute
-
-
-
-
Constructor Detail
-
ForJnaPosixSocket
protected ForJnaPosixSocket(VirtualMachine.ForHotSpot.Connection.ForJnaPosixSocket.PosixLibrary library, 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 Integer connect()
Description copied from class:VirtualMachine.ForHotSpot.Connection.OnPersistentByteChannelCreates a new connection to the target VM.- Specified by:
connectin classVirtualMachine.ForHotSpot.Connection.OnPersistentByteChannel<Integer>- Returns:
- Returns a new connection to the target VM.
-
read
protected int read(Integer handle, byte[] buffer)
Description copied from class:VirtualMachine.ForHotSpot.Connection.OnPersistentByteChannelReads from the target VM.- Specified by:
readin classVirtualMachine.ForHotSpot.Connection.OnPersistentByteChannel<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(Integer handle, byte[] buffer)
Description copied from class:VirtualMachine.ForHotSpot.Connection.OnPersistentByteChannelWrites to the target VM.- Specified by:
writein classVirtualMachine.ForHotSpot.Connection.OnPersistentByteChannel<Integer>- Parameters:
handle- The connection to write to.buffer- The buffer to write to.
-
close
protected void close(Integer handle)
Description copied from class:VirtualMachine.ForHotSpot.Connection.OnPersistentByteChannelCloses the connection to the target VM.- Specified by:
closein classVirtualMachine.ForHotSpot.Connection.OnPersistentByteChannel<Integer>- Parameters:
handle- The connection to close.
-
close
public void close()
-
-