Package net.bytebuddy.agent
Class VirtualMachine.ForHotSpot.Connection.Factory.ForSocketFile
- java.lang.Object
-
- net.bytebuddy.agent.VirtualMachine.ForHotSpot.Connection.Factory.ForSocketFile
-
- All Implemented Interfaces:
VirtualMachine.ForHotSpot.Connection.Factory
- Direct Known Subclasses:
VirtualMachine.ForHotSpot.Connection.ForJnaPosixSocket.Factory
,VirtualMachine.ForHotSpot.Connection.ForJnaSolarisDoor.Factory
- Enclosing interface:
- VirtualMachine.ForHotSpot.Connection.Factory
public abstract static class VirtualMachine.ForHotSpot.Connection.Factory.ForSocketFile extends Object implements VirtualMachine.ForHotSpot.Connection.Factory
A factory for attaching via a socket file.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface net.bytebuddy.agent.VirtualMachine.ForHotSpot.Connection.Factory
VirtualMachine.ForHotSpot.Connection.Factory.ForSocketFile
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
ForSocketFile(String temporaryDirectory, int attempts, long pause, TimeUnit timeUnit)
Creates a connection factory for creating a socket connection via a file.
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description VirtualMachine.ForHotSpot.Connection
connect(String processId)
Connects to the supplied process.protected abstract VirtualMachine.ForHotSpot.Connection
doConnect(File socket)
Connects to the supplied POSIX socket.protected abstract void
kill(String processId, int signal)
Sends a kill signal to the target process.
-
-
-
Constructor Detail
-
ForSocketFile
protected ForSocketFile(String temporaryDirectory, int attempts, long pause, TimeUnit timeUnit)
Creates a connection factory for creating a socket connection via a file.- 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
-
connect
public VirtualMachine.ForHotSpot.Connection connect(String processId) throws IOException
Connects to the supplied process.- Specified by:
connect
in interfaceVirtualMachine.ForHotSpot.Connection.Factory
- Parameters:
processId
- The process id.- Returns:
- The connection to the virtual machine with the supplied process id.
- Throws:
IOException
- If an I/O exception occurs during connecting to the targeted VM.
-
kill
protected abstract void kill(String processId, int signal)
Sends a kill signal to the target process.- Parameters:
processId
- The process id.signal
- The signal to send.
-
doConnect
protected abstract VirtualMachine.ForHotSpot.Connection doConnect(File socket) throws IOException
Connects to the supplied POSIX socket.- Parameters:
socket
- The socket to connect to.- Returns:
- An active connection to the supplied socket.
- Throws:
IOException
- If an error occurs during connection.
-
-