Package org.eclipse.mat.snapshot.acquire
Class VmInfo
java.lang.Object
org.eclipse.mat.snapshot.acquire.VmInfo
- Direct Known Subclasses:
IBMVmInfo
,JmapVmInfo
Instances of this class are descriptors of locally running Java processes.
Arguments can be injected into the query using public fields marked with the
Argument
annotation.
Typical arguments to be supplied by the user of the heap dump provider include
- boolean flags
- int parm
- File file optionally tagged with tagged with
Argument.Advice.DIRECTORY
orArgument.Advice.SAVE
. - enum - an enum
- Since:
- 1.0
-
Constructor Summary
ConstructorDescriptionVmInfo()
An empty constructorVmInfo
(int pid, String description, boolean heapDumpEnabled, String proposedFileName, IHeapDumpProvider heapDumpProvider) Constructor with parameters -
Method Summary
Modifier and TypeMethodDescriptionGet the description of the Java processGet the heap dump provider which returned this VmInfoint
getPid()
Get the PID of the processReturns a proposed file name under which the heap dump should be saved, e.g.boolean
Indicate if a heap dump can be acquired from the described processvoid
setDescription
(String description) Set the description of the Java processvoid
setHeapDumpEnabled
(boolean heapDumpEnabled) Set the flag if heap dumps can be acquired from the described processvoid
setHeapDumpProvider
(IHeapDumpProvider heapDumpProvider) Set the heap dump provider of this VmInfovoid
setPid
(int pid) Set the PID for the process descriptorvoid
setProposedFileName
(String proposedFileName) Set the proposed file name for this processtoString()
-
Constructor Details
-
VmInfo
public VmInfo()An empty constructor -
VmInfo
public VmInfo(int pid, String description, boolean heapDumpEnabled, String proposedFileName, IHeapDumpProvider heapDumpProvider) Constructor with parameters- Parameters:
pid
- the process ID of the processdescription
- a free text description of the process, usually the process nameheapDumpEnabled
- a boolean value indicating if a heap dump from the process can be acquiredproposedFileName
- a proposal for the file name, under which the heap dump can be saved. %pid% can be used as a placeholder for the PID. Example: java_pid%pid%.hprofheapDumpProvider
- theIHeapDumpProvider
which can use this VmInfo
-
-
Method Details
-
getPid
public int getPid()Get the PID of the process- Returns:
- the process ID
-
setPid
public void setPid(int pid) Set the PID for the process descriptor- Parameters:
pid
- process identifier
-
getDescription
Get the description of the Java process- Returns:
- the description
-
setDescription
Set the description of the Java process- Parameters:
description
- description of the Java process
-
isHeapDumpEnabled
public boolean isHeapDumpEnabled()Indicate if a heap dump can be acquired from the described process- Returns:
- true if the heap dump can be triggered
-
setHeapDumpEnabled
public void setHeapDumpEnabled(boolean heapDumpEnabled) Set the flag if heap dumps can be acquired from the described process- Parameters:
heapDumpEnabled
- true if a heap dump is possible on this process
-
getHeapDumpProvider
Get the heap dump provider which returned this VmInfo- Returns:
- the heap dump provider
-
setHeapDumpProvider
Set the heap dump provider of this VmInfo- Parameters:
heapDumpProvider
-
-
getProposedFileName
Returns a proposed file name under which the heap dump should be saved, e.g. java_pid%pid%.hprof for HPROF files or a file name template subject to substitution usingMessageUtil.format(java.lang.String, java.lang.Object...)
with three parameters,Date
date, int pid, int index For example: mydumpname.{0,date,yyyyMMdd.HHmmss}.{1,number,0}.{2,number,0000}.dmp- Returns:
- a suggested file name template
-
setProposedFileName
Set the proposed file name for this process- Parameters:
proposedFileName
-
-
toString
-