public interface VirtualMachine
An implementation for attachment on a virtual machine. This interface mimics the tooling API's virtual
machine interface to allow for similar usage by ByteBuddyAgent
where all calls are made via
reflection such that this structural typing suffices for interoperability.
Note: Implementations are required to declare a static method attach(String)
returning an
instance of a class that declares the methods defined by VirtualMachine
.
Modifier and Type | Interface and Description |
---|---|
static class |
VirtualMachine.ForHotSpot
A virtual machine implementation for a HotSpot VM or any compatible VM.
|
Modifier and Type | Method and Description |
---|---|
void |
detach()
Detaches this virtual machine representation.
|
void |
loadAgent(String jarFile,
String argument)
Loads an agent into the represented virtual machine.
|
void loadAgent(String jarFile, String argument) throws IOException
jarFile
- The jar file to attach.argument
- The argument to provide or null
if no argument should be provided.IOException
- If an I/O exception occurs.void detach() throws IOException
IOException
- If an I/O exception occurs.Copyright © 2014–2016. All rights reserved.