|
Jvmstat | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectsun.jvmstat.perfdata.monitor.AbstractMonitoredVm
public abstract class AbstractMonitoredVm
Base class for all MonitoredVm implementations that utilize the HotSpot PerfData instrumentation buffer as the communications mechanism to the target Java Virtual Machine.
Field Summary | |
---|---|
protected int |
interval
The sampling interval, if the instrumentation buffer is acquired by sampling instead of shared memory mechanisms. |
protected AbstractPerfDataBuffer |
pdb
The shared memory instrumentation buffer for the target. |
protected VmIdentifier |
vmid
The VmIdentifier for the target. |
Constructor Summary | |
---|---|
AbstractMonitoredVm(VmIdentifier vmid,
int interval)
Create an AbstractMonitoredVm instance. |
Method Summary | |
---|---|
abstract void |
addVmListener(VmListener l)
Add a VmListener. |
void |
clearLastException()
Clear the last exception. |
void |
detach()
Detach from target Java Virtual Machine. |
Monitor |
findByName(String name)
Find a named Instrumentation object. |
List |
findByPattern(String patternString)
Find all Instrumentation objects with names matching the given pattern. |
byte[] |
getBytes()
Interface to get the bytes associated with the instrumentation for the target Java Virtual Machine. |
int |
getCapacity()
Interface to get the the size of the instrumentation buffer for the target Java Virtual Machine. |
int |
getInterval()
Get the polling interval. |
Exception |
getLastException()
Get the last exception encountered while polling this MonitoredVm. |
MonitorStatus |
getMonitorStatus()
Get a list of the inserted and removed monitors since last called. |
VmIdentifier |
getVmIdentifier()
Get the VmIdentifier associated with this MonitoredVm |
boolean |
isErrored()
Test if this MonitoredVm is in the errored state. |
abstract void |
removeVmListener(VmListener l)
Remove a VmListener. |
void |
setInterval(int interval)
Set the polling interval to interval milliseconds. |
void |
setLastException(Exception e)
Set the last exception encountered while polling this MonitoredVm. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected VmIdentifier vmid
protected AbstractPerfDataBuffer pdb
protected int interval
Constructor Detail |
---|
public AbstractMonitoredVm(VmIdentifier vmid, int interval) throws MonitorException
vmid
- the VmIdentifier for the targetinterval
- the initial sampling interval
MonitorException
Method Detail |
---|
public VmIdentifier getVmIdentifier()
getVmIdentifier
in interface MonitoredVm
public Monitor findByName(String name) throws MonitorException
findByName
in interface MonitoredVm
name
- the name of the Instrumentation object to find.
Monitor
object that can be used to
monitor the the named instrumentation object, or
null if the named object doesn't exist.
MonitorException
- Thrown if an error occurs while communicating
with the target Java Virtual Machine.public List findByPattern(String patternString) throws MonitorException
List
of Monitor objects such that
the name of each object matches the given pattern.
findByPattern
in interface MonitoredVm
patternString
- a string containing a pattern as described in
Pattern
.
Monitor
objects that can be used to
monitor the instrumentation objects whose names match
the given pattern. If no instrumentation objects have`
names matching the given pattern, then an empty List
is returned.
MonitorException
- Thrown if an error occurs while communicating
with the target Java Virtual Machine.Pattern
public void detach()
detach
in interface MonitoredVm
public void setInterval(int interval)
interval
milliseconds.
Polling based monitoring implementations need to refresh the
instrumentation data on a periodic basis. This interface allows
the interval to override the implementation specific default
interval.
setInterval
in interface MonitoredVm
interval
- the polling interval in millisecondspublic int getInterval()
getInterval
in interface MonitoredVm
MonitoredVm.setInterval(int)
public void setLastException(Exception e)
setLastException
in interface MonitoredVm
e
- the exception to record.MonitoredVm.isErrored()
public Exception getLastException()
getLastException
in interface MonitoredVm
MonitoredVm.isErrored()
,
MonitoredVm.setLastException(java.lang.Exception)
public void clearLastException()
clearLastException
in interface MonitoredVm
public boolean isErrored()
MonitoredVm.setLastException(java.lang.Exception)
and only if the parameter to
that call was non-null and no subsequent calls are made to
MonitoredVm.clearLastException()
.
isErrored
in interface MonitoredVm
MonitoredVm.setLastException(java.lang.Exception)
,
MonitoredVm.getLastException()
public MonitorStatus getMonitorStatus() throws MonitorException
MonitorException
- Thrown if communications errors occur
while communicating with the target.public abstract void addVmListener(VmListener l)
addVmListener
in interface MonitoredVm
l
- the VmListener to add.public abstract void removeVmListener(VmListener l)
removeVmListener
in interface MonitoredVm
l
- the VmListener to be removed.public byte[] getBytes()
getBytes
in interface BufferedMonitoredVm
public int getCapacity()
getCapacity
in interface BufferedMonitoredVm
|
Jvmstat | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |