public abstract class AbstractBaseCommand extends Object
Constructor and Description |
---|
AbstractBaseCommand() |
Modifier and Type | Method and Description |
---|---|
protected String |
checkAgentUrl(Object pVm)
Check whether an agent is registered by checking the existance of the system property
JvmAgent.JOLOKIA_AGENT_URL . |
protected String |
checkAgentUrl(Object pVm,
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)
Execute
com.sun.tools.attach.VirtualMachine#getSystemProperties() via reflection |
protected String |
getProcessDescription(OptionsAndArgs pOpts,
VirtualMachineHandler pHandler)
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,
OptionsAndArgs pOpts,
String... pAdditionalOpts)
Execute
com.sun.tools.attach.VirtualMachine#loadAgent(String, String) via reflection |
protected void loadAgent(Object pVm, OptionsAndArgs pOpts, String... pAdditionalOpts) throws NoSuchMethodException, InvocationTargetException, IllegalAccessException
com.sun.tools.attach.VirtualMachine#loadAgent(String, String)
via reflectionpVm
- the VirtualMachine object, typelesspOpts
- 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.NoSuchMethodException
InvocationTargetException
IllegalAccessException
protected String checkAgentUrl(Object pVm) throws NoSuchMethodException, InvocationTargetException, IllegalAccessException
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 com.sun.tools.attach.VirtualMachine
, but typelessNoSuchMethodException
InvocationTargetException
IllegalAccessException
protected String checkAgentUrl(Object pVm, int delayInMs) throws NoSuchMethodException, InvocationTargetException, IllegalAccessException
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 com.sun.tools.attach.VirtualMachine
, but typelessdelayInMs
- wait that many ms before fetching the propertiesNoSuchMethodException
InvocationTargetException
IllegalAccessException
protected Properties getAgentSystemProperties(Object pVm) throws NoSuchMethodException, InvocationTargetException, IllegalAccessException
com.sun.tools.attach.VirtualMachine#getSystemProperties()
via reflectionpVm
- the VirtualMachine object, typelessNoSuchMethodException
InvocationTargetException
IllegalAccessException
protected String getProcessDescription(OptionsAndArgs pOpts, VirtualMachineHandler pHandler)
pOpts
- options from where to take the PID or patternpHandler
- handler for looking up the process in case of a pattern lookupCopyright © 2019. All rights reserved.