Package net.bytebuddy.agent
Class VirtualMachine.ForHotSpot.Connection.ForJnaPosixSocket.Factory
- java.lang.Object
-
- net.bytebuddy.agent.VirtualMachine.ForHotSpot.Connection.Factory.ForSocketFile
-
- net.bytebuddy.agent.VirtualMachine.ForHotSpot.Connection.ForJnaPosixSocket.Factory
-
- All Implemented Interfaces:
VirtualMachine.ForHotSpot.Connection.Factory
- Enclosing class:
- VirtualMachine.ForHotSpot.Connection.ForJnaPosixSocket
public static class VirtualMachine.ForHotSpot.Connection.ForJnaPosixSocket.Factory extends VirtualMachine.ForHotSpot.Connection.Factory.ForSocketFile
A factory for a POSIX socket connection to a JVM using JNA.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static interfaceVirtualMachine.ForHotSpot.Connection.ForJnaPosixSocket.Factory.MacLibraryA library for reading a Mac user's temporary directory.-
Nested classes/interfaces inherited from interface net.bytebuddy.agent.VirtualMachine.ForHotSpot.Connection.Factory
VirtualMachine.ForHotSpot.Connection.Factory.ForSocketFile
-
-
Field Summary
Fields Modifier and Type Field Description private VirtualMachine.ForHotSpot.Connection.ForJnaPosixSocket.PosixLibrarylibraryThe socket library API.
-
Constructor Summary
Constructors Constructor Description Factory(java.lang.String temporaryDirectory, int attempts, long pause, java.util.concurrent.TimeUnit timeUnit)Creates a connection factory for a POSIX socket using JNA.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description VirtualMachine.ForHotSpot.ConnectiondoConnect(java.io.File socket)Connects to the supplied POSIX socket.protected voidkill(java.lang.String processId, int signal)Sends a kill signal to the target process.static VirtualMachine.ForHotSpot.Connection.FactorywithDefaultTemporaryFolder(int attempts, long pause, java.util.concurrent.TimeUnit timeUnit)Creates a connection factory for a POSIX socket using JNA while locating the default temporary directory used on the current platform.-
Methods inherited from class net.bytebuddy.agent.VirtualMachine.ForHotSpot.Connection.Factory.ForSocketFile
connect
-
-
-
-
Field Detail
-
library
private final VirtualMachine.ForHotSpot.Connection.ForJnaPosixSocket.PosixLibrary library
The socket library API.
-
-
Constructor Detail
-
Factory
public Factory(java.lang.String temporaryDirectory, int attempts, long pause, java.util.concurrent.TimeUnit timeUnit)Creates a connection factory for a POSIX socket using JNA.- Parameters:
temporaryDirectory- The temporary directory to use.attempts- The maximum amount of attempts for checking the establishment of a socket connection.pause- The pause between two checks for an established socket connection.timeUnit- The time unit of the pause time.
-
-
Method Detail
-
withDefaultTemporaryFolder
public static VirtualMachine.ForHotSpot.Connection.Factory withDefaultTemporaryFolder(int attempts, long pause, java.util.concurrent.TimeUnit timeUnit)
Creates a connection factory for a POSIX socket using JNA while locating the default temporary directory used on the current platform.- Parameters:
attempts- The maximum amount of attempts for checking the establishment of a socket connection.pause- The pause between two checks for an established socket connection.timeUnit- The time unit of the pause time.- Returns:
- An appropriate connection factory.
-
kill
protected void kill(java.lang.String processId, int signal)Description copied from class:VirtualMachine.ForHotSpot.Connection.Factory.ForSocketFileSends a kill signal to the target process.- Specified by:
killin classVirtualMachine.ForHotSpot.Connection.Factory.ForSocketFile- Parameters:
processId- The process id.signal- The signal to send.
-
doConnect
public VirtualMachine.ForHotSpot.Connection doConnect(java.io.File socket)
Description copied from class:VirtualMachine.ForHotSpot.Connection.Factory.ForSocketFileConnects to the supplied POSIX socket.- Specified by:
doConnectin classVirtualMachine.ForHotSpot.Connection.Factory.ForSocketFile- Parameters:
socket- The socket to connect to.- Returns:
- An active connection to the supplied socket.
-
-