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.AbstractBase
An abstract base implementation for a virtual machine.
|
static class |
VirtualMachine.ForHotSpot
A virtual machine attachment implementation for a HotSpot VM or any compatible JVM.
|
static class |
VirtualMachine.ForOpenJ9
A virtual machine attachment implementation for OpenJ9 or any compatible JVM.
|
static class |
VirtualMachine.Resolver
A resolver for the current VM's virtual machine attachment emulation.
|
Modifier and Type | Method and Description |
---|---|
void |
detach()
Detaches this virtual machine representation.
|
Properties |
getAgentProperties()
Loads the target VMs agent properties.
|
Properties |
getSystemProperties()
Loads the target VMs system properties.
|
void |
loadAgent(String jarFile)
Loads an agent into the represented virtual machine.
|
void |
loadAgent(String jarFile,
String argument)
Loads an agent into the represented virtual machine.
|
void |
loadAgentLibrary(String library)
Loads a native agent library into the represented virtual machine.
|
void |
loadAgentLibrary(String library,
String argument)
Loads a native agent library into the represented virtual machine.
|
void |
loadAgentPath(String path)
Loads a native agent into the represented virtual machine.
|
void |
loadAgentPath(String path,
String argument)
Loads a native agent into the represented virtual machine.
|
String |
startLocalManagementAgent()
Starts a local management agent.
|
void |
startManagementAgent(Properties properties)
Starts a JMX management agent.
|
Properties getSystemProperties() throws IOException
IOException
- If an I/O exception occurs.Properties getAgentProperties() throws IOException
IOException
- If an I/O exception occurs.void loadAgent(String jarFile) throws IOException
jarFile
- The jar file to attach.IOException
- If an I/O exception occurs.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 loadAgentPath(String path) throws IOException
path
- The agent path.IOException
- If an I/O exception occurs.void loadAgentPath(String path, String argument) throws IOException
path
- The agent path.argument
- The argument to provide or null
if no argument should be provided.IOException
- If an I/O exception occurs.void loadAgentLibrary(String library) throws IOException
library
- The agent library.IOException
- If an I/O exception occurs.void loadAgentLibrary(String library, String argument) throws IOException
library
- The agent library.argument
- The argument to provide or null
if no argument should be provided.IOException
- If an I/O exception occurs.void startManagementAgent(Properties properties) throws IOException
properties
- The properties to transfer to the JMX agent.IOException
- If an I/O error occurs.String startLocalManagementAgent() throws IOException
IOException
- If an I/O error occurs.void detach() throws IOException
IOException
- If an I/O exception occurs.Copyright © 2014–2021. All rights reserved.