public abstract class AbstractBaseCommand extends Object
| Constructor and Description |
|---|
AbstractBaseCommand() |
| Modifier and Type | Method and Description |
|---|---|
protected String |
checkAgentUrl(Object pVm,
VirtualMachineHandlerOperations pHandler)
Check whether an agent is registered by checking the existance of the system property
JvmAgent.JOLOKIA_AGENT_URL. |
protected String |
checkAgentUrl(Object pVm,
VirtualMachineHandlerOperations pHandler,
int delayInMs)
Check whether an agent is registered by checking the existance of the system property
JvmAgent.JOLOKIA_AGENT_URL. |
protected Properties |
getAgentSystemProperties(Object pVm,
VirtualMachineHandlerOperations pHandler)
Execute
VirtualMachine.getSystemProperties() via reflection |
protected String |
getProcessDescription(VirtualMachineHandlerOperations pHandler,
OptionsAndArgs pOpts)
Get a description of the process attached, either the numeric id only or, if a pattern is given,
the pattern and the associated PID
|
protected void |
loadAgent(Object pVm,
VirtualMachineHandlerOperations pHandler,
OptionsAndArgs pOpts,
String... pAdditionalOpts)
Execute
com.sun.tools.attach.VirtualMachine#loadAgent(String, String) |
protected void loadAgent(Object pVm, VirtualMachineHandlerOperations pHandler, OptionsAndArgs pOpts, String... pAdditionalOpts)
com.sun.tools.attach.VirtualMachine#loadAgent(String, String)pVm - the VirtualMachine object, typelesspHandler - platform-specific way to invoke operations on VMpOpts - options from where to extract the agent path and optionspAdditionalOpts - optional additional options to be appended to the agent options. Must be a CSV string.protected String checkAgentUrl(Object pVm, VirtualMachineHandlerOperations pHandler)
JvmAgent.JOLOKIA_AGENT_URL. This can be used to check, whether a Jolokia agent
has been already attached and started. ("start" will set this property, "stop" will remove it).pVm - the VirtualMachine, but typelesspHandler - platform-specific way to invoke operations on VMprotected String checkAgentUrl(Object pVm, VirtualMachineHandlerOperations pHandler, int delayInMs)
JvmAgent.JOLOKIA_AGENT_URL. This can be used to check, whether a Jolokia agent
has been already attached and started. ("start" will set this property, "stop" will remove it).pVm - the VirtualMachine, but typelesspHandler - platform-specific way to invoke operations on VMdelayInMs - wait that many ms before fetching the propertiesprotected Properties getAgentSystemProperties(Object pVm, VirtualMachineHandlerOperations pHandler)
VirtualMachine.getSystemProperties() via reflectionpVm - the VirtualMachine object, typelesspHandler - platform-specific way to invoke operations on VMprotected String getProcessDescription(VirtualMachineHandlerOperations pHandler, OptionsAndArgs pOpts)
pHandler - handler for looking up the process in case of a pattern lookuppOpts - options from where to take the PID or patternCopyright © 2022. All rights reserved.