public class Attacher extends Object
Modifier and Type | Method and Description |
---|---|
protected static void |
install(Class<?> virtualMachineType,
String processId,
String agent,
String argument)
Installs a Java agent on a target VM.
|
static void |
main(String[] args)
Runs the attacher as a Java application.
|
public static void main(String[] args)
args
- A list containing the fully qualified name of the virtual machine type,
the process id, the fully qualified name of the Java agent jar followed by
an empty string if the argument to the agent is null
or any number
of strings where the first argument is proceeded by any single character
which is stripped off.protected static void install(Class<?> virtualMachineType, String processId, String agent, String argument) throws NoSuchMethodException, InvocationTargetException, IllegalAccessException
virtualMachineType
- The virtual machine type to use for the external attachment.processId
- The id of the process being target of the external attachment.agent
- The Java agent to attach.argument
- The argument to provide or null
if no argument is provided.NoSuchMethodException
- If the virtual machine type does not define an expected method.InvocationTargetException
- If the virtual machine type raises an error.IllegalAccessException
- If a method of the virtual machine type cannot be accessed.Copyright © 2014–2017. All rights reserved.