public interface VirtualMachineHandlerOperations
A contract for dealing with VirtualMachine on any JDK where
Attach API is supported.
The virtual machine is passed as Object and dealt with differently in chosen implementation of the
contract.
| Modifier and Type | Method and Description |
|---|---|
Object |
attachVirtualMachine()
Lookup and create a
com.sun.tools.attach.VirtualMachine |
void |
detachAgent(Object pVm)
Detach from the virtual machine
|
ProcessDescription |
findProcess(Pattern pPattern)
Filter the process list for a regular expression and returns the description.
|
Properties |
getSystemProperties(Object pVm)
Returns system properties from attached VM.
|
List<ProcessDescription> |
listProcesses()
Return a list of all Java processes
|
void |
loadAgent(Object pVm,
String jarFilePath,
String args)
Loads Jolokia agent into the attached VM.
|
Object attachVirtualMachine() throws ProcessingException
com.sun.tools.attach.VirtualMachinenull if none could be createdProcessingException - for any problem related to VM attaching. Specific to particular implementation.void detachAgent(Object pVm) throws ProcessingException
pVm - the virtual machine to detach fromProcessingException - for any problem related to VM detaching. Specific to particular implementation.List<ProcessDescription> listProcesses()
ProcessDescription findProcess(Pattern pPattern)
pPattern - regular expression to matchIllegalArgumentException - if more than one or no process has been found.void loadAgent(Object pVm, String jarFilePath, String args)
pVm - VirtualMachine access objectjarFilePath - path to Java agent JAR fileargs - arguments to VirtualMachine.loadAgent(String, String) methodProperties getSystemProperties(Object pVm)
pVm - VirtualMachine access objectCopyright © 2022. All rights reserved.