Package net.bytebuddy.agent
Class VirtualMachine.ForHotSpot
- java.lang.Object
-
- net.bytebuddy.agent.VirtualMachine.ForHotSpot
-
- All Implemented Interfaces:
VirtualMachine
- Direct Known Subclasses:
VirtualMachine.ForHotSpot.OnUnix
- Enclosing interface:
- VirtualMachine
public abstract static class VirtualMachine.ForHotSpot extends java.lang.Object implements VirtualMachine
A virtual machine implementation for a HotSpot VM or any compatible VM.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classVirtualMachine.ForHotSpot.OnUnixA virtual machine implementation for a HotSpot VM running on Unix.-
Nested classes/interfaces inherited from interface net.bytebuddy.agent.VirtualMachine
VirtualMachine.ForHotSpot
-
-
Field Summary
Fields Modifier and Type Field Description protected java.lang.StringprocessIdThe target process's id.
-
Constructor Summary
Constructors Modifier Constructor Description protectedForHotSpot(java.lang.String processId)Creates a new HotSpot-compatible VM implementation.
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected abstract voidconnect()Connects to the target VM.voidloadAgent(java.lang.String jarFile, java.lang.String argument)Loads an agent into the represented virtual machine.protected abstract intread(byte[] buffer)Reads from the communication channel.protected abstract voidwrite(byte[] buffer)Writes to the communication channel.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface net.bytebuddy.agent.VirtualMachine
detach
-
-
-
-
Method Detail
-
loadAgent
public void loadAgent(java.lang.String jarFile, java.lang.String argument) throws java.io.IOExceptionDescription copied from interface:VirtualMachineLoads an agent into the represented virtual machine.- Specified by:
loadAgentin interfaceVirtualMachine- Parameters:
jarFile- The jar file to attach.argument- The argument to provide ornullif no argument should be provided.- Throws:
java.io.IOException- If an I/O exception occurs.
-
connect
protected abstract void connect() throws java.io.IOExceptionConnects to the target VM.- Throws:
java.io.IOException- If an I/O exception occurs.
-
read
protected abstract int read(byte[] buffer) throws java.io.IOExceptionReads from the communication channel.- Parameters:
buffer- The buffer to read into.- Returns:
- The amount of bytes read.
- Throws:
java.io.IOException- If an I/O exception occurs.
-
write
protected abstract void write(byte[] buffer) throws java.io.IOExceptionWrites to the communication channel.- Parameters:
buffer- The buffer to write from.- Throws:
java.io.IOException- If an I/O exception occurs.
-
-