APIdia Launch Partner
Top Description Fields Constructors Methods
sun.jvmstat.perfdata.monitor

public abstract Class AbstractMonitoredVm

extends Object
implements BufferedMonitoredVm
Class Inheritance
All Implemented Interfaces
sun.jvmstat.monitor.BufferedMonitoredVm, sun.jvmstat.monitor.MonitoredVm
Known Direct Subclasses
sun.jvmstat.perfdata.monitor.protocol.file.FileMonitoredVm, sun.jvmstat.perfdata.monitor.protocol.local.LocalMonitoredVm
Imports
java.util.List, sun.jvmstat.monitor.*, sun.jvmstat.monitor.event.VmListener

Base class for all MonitoredVm implementations that utilize the HotSpot PerfData instrumentation buffer as the communications mechanism to the target Java Virtual Machine.
Author
Brian Doherty
Since
1.5

Field Summary

Modifier and TypeField and Description
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

AccessConstructor and Description
public
AbstractMonitoredVm(VmIdentifier
the VmIdentifier for the target
vmid
,
int
the initial sampling interval
interval
)

Create an AbstractMonitoredVm instance.

Method Summary

Modifier and TypeMethod and Description
public abstract void
public void
public void
detach()

Implements sun.jvmstat.monitor.MonitoredVm.detach.

Detach from target Java Virtual Machine.

public Monitor
findByName(String name)

Implements sun.jvmstat.monitor.MonitoredVm.findByName.

Find a named Instrumentation object.

public List<Monitor>
findByPattern(String patternString)

Implements sun.jvmstat.monitor.MonitoredVm.findByPattern.

Find all Instrumentation objects with names matching the given pattern.

public byte[]
getBytes()

Implements sun.jvmstat.monitor.BufferedMonitoredVm.getBytes.

Interface to get the bytes associated with the instrumentation for the target Java Virtual Machine.

public int
getCapacity()

Implements sun.jvmstat.monitor.BufferedMonitoredVm.getCapacity.

Interface to get the size of the instrumentation buffer for the target Java Virtual Machine.

public int
getInterval()

Implements sun.jvmstat.monitor.MonitoredVm.getInterval.

Get the polling interval.

public Exception
getLastException()

Implements sun.jvmstat.monitor.MonitoredVm.getLastException.

Get the last exception encountered while polling this MonitoredVm.

public MonitorStatus

Returns:

MonitorStatus - the status of available Monitors for the target Java Virtual Machine.
getMonitorStatus
()

Get a list of the inserted and removed monitors since last called.

public VmIdentifier
getVmIdentifier()

Implements sun.jvmstat.monitor.MonitoredVm.getVmIdentifier.

Get the VmIdentifier associated with this MonitoredVm

public boolean
isErrored()

Implements sun.jvmstat.monitor.MonitoredVm.isErrored.

Test if this MonitoredVm is in the errored state.

public abstract void
public void
setInterval(int interval)

Implements sun.jvmstat.monitor.MonitoredVm.setInterval.

Set the polling interval to interval milliseconds.

public void
setLastException(Exception e)

Implements sun.jvmstat.monitor.MonitoredVm.setLastException.

Set the last exception encountered while polling this MonitoredVm.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

intervalback to summary
protected int interval

The sampling interval, if the instrumentation buffer is acquired by sampling instead of shared memory mechanisms.

pdbback to summary
protected AbstractPerfDataBuffer pdb

The shared memory instrumentation buffer for the target.

vmidback to summary
protected VmIdentifier vmid

The VmIdentifier for the target.

Constructor Detail

AbstractMonitoredVmback to summary
public AbstractMonitoredVm(VmIdentifier vmid, int interval) throws MonitorException

Create an AbstractMonitoredVm instance.

Parameters
vmid:VmIdentifier

the VmIdentifier for the target

interval:int

the initial sampling interval

Method Detail

addVmListenerback to summary
public abstract void addVmListener(VmListener l)

Redeclares sun.jvmstat.monitor.MonitoredVm.addVmListener.

Doc from sun.jvmstat.monitor.MonitoredVm.addVmListener.

Add a VmListener. The given listener is added to the list of VmListener objects to be notified of MonitoredVm related events.

clearLastExceptionback to summary
public void clearLastException()

Implements sun.jvmstat.monitor.MonitoredVm.clearLastException.

Doc from sun.jvmstat.monitor.MonitoredVm.clearLastException.

Clear the last exception. Calling this method will clear the errored state of this MonitoredVm. However, there is no guarantee that clearing the the errored state return the asynchronous polling task to an operational state.

detachback to summary
public void detach()

Implements sun.jvmstat.monitor.MonitoredVm.detach.

Doc from sun.jvmstat.monitor.MonitoredVm.detach.

Detach from target Java Virtual Machine. After calling this method, updates of the instrumentation data values may be halted. All event notifications are halted. Further interactions with this object should be avoided.

findByNameback to summary
public Monitor findByName(String name) throws MonitorException

Implements sun.jvmstat.monitor.MonitoredVm.findByName.

Doc from sun.jvmstat.monitor.MonitoredVm.findByName.

Find a named Instrumentation object. This method will look for the named instrumentation object in the instrumentation exported by this Java Virtual Machine. If an instrumentation object with the given name exists, a Monitor interface to that object will be return. Otherwise, the method returns null.

Exceptions
MonitorException:
Thrown if an error occurs while communicating with the target Java Virtual Machine.
findByPatternback to summary
public List<Monitor> findByPattern(String patternString) throws MonitorException

Implements sun.jvmstat.monitor.MonitoredVm.findByPattern.

Doc from sun.jvmstat.monitor.MonitoredVm.findByPattern.

Find all Instrumentation objects with names matching the given pattern. This method returns a List of Monitor objects such that the name of each object matches the given pattern.

Exceptions
MonitorException:
Thrown if an error occurs while communicating with the target Java Virtual Machine.
getBytesback to summary
public byte[] getBytes()

Implements sun.jvmstat.monitor.BufferedMonitoredVm.getBytes.

Doc from sun.jvmstat.monitor.BufferedMonitoredVm.getBytes.

Interface to get the bytes associated with the instrumentation for the target Java Virtual Machine.

getCapacityback to summary
public int getCapacity()

Implements sun.jvmstat.monitor.BufferedMonitoredVm.getCapacity.

Doc from sun.jvmstat.monitor.BufferedMonitoredVm.getCapacity.

Interface to get the size of the instrumentation buffer for the target Java Virtual Machine.

getIntervalback to summary
public int getInterval()

Implements sun.jvmstat.monitor.MonitoredVm.getInterval.

Doc from sun.jvmstat.monitor.MonitoredVm.getInterval.

Get the polling interval.

getLastExceptionback to summary
public Exception getLastException()

Implements sun.jvmstat.monitor.MonitoredVm.getLastException.

Doc from sun.jvmstat.monitor.MonitoredVm.getLastException.

Get the last exception encountered while polling this MonitoredVm. Returns the last exception observed by the implementation dependent polling task or null if no such error has occurred.

getMonitorStatusback to summary
public MonitorStatus getMonitorStatus() throws MonitorException

Get a list of the inserted and removed monitors since last called.

Returns:MonitorStatus

MonitorStatus - the status of available Monitors for the target Java Virtual Machine.

Exceptions
MonitorException:
Thrown if communications errors occur while communicating with the target.
getVmIdentifierback to summary
public VmIdentifier getVmIdentifier()

Implements sun.jvmstat.monitor.MonitoredVm.getVmIdentifier.

Doc from sun.jvmstat.monitor.MonitoredVm.getVmIdentifier.

Get the VmIdentifier associated with this MonitoredVm

isErroredback to summary
public boolean isErrored()

Implements sun.jvmstat.monitor.MonitoredVm.isErrored.

Doc from sun.jvmstat.monitor.MonitoredVm.isErrored.

Test if this MonitoredVm is in the errored state. The errored state exists only if an error was reported with call to setLastException and only if the parameter to that call was non-null and no subsequent calls are made to clearLastException.

removeVmListenerback to summary
public abstract void removeVmListener(VmListener l)

Redeclares sun.jvmstat.monitor.MonitoredVm.removeVmListener.

Doc from sun.jvmstat.monitor.MonitoredVm.removeVmListener.

Remove a VmListener. The given listener is removed from the list of VmListener objects to be notified of MonitoredVm related events.

setIntervalback to summary
public void setInterval(int interval)

Implements sun.jvmstat.monitor.MonitoredVm.setInterval.

Doc from sun.jvmstat.monitor.MonitoredVm.setInterval.

Set the polling interval to 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.

setLastExceptionback to summary
public void setLastException(Exception e)

Implements sun.jvmstat.monitor.MonitoredVm.setLastException.

Doc from sun.jvmstat.monitor.MonitoredVm.setLastException.

Set the last exception encountered while polling this MonitoredVm. Polling implementations may choose to poll asynchronously. This method allows an asynchronous task to communicate any polling related exceptions with the application. When a non-null exception is reported through this interface, the MonitoredVm instance is considered to be in the errored state.