public abstract class

PerfDataBufferImpl

extends Object
java.lang.Object
   ↳ sun.jvmstat.perfdata.monitor.PerfDataBufferImpl
Known Direct Subclasses

Class Overview

The base classes for the concrete implementations of the HotSpot PerfData instrumentation buffer.

Summary

Fields
protected Map aliasCache A cache of resolved monitor aliases.
protected Map<StringArrayList<String>> aliasMap A Map of monitor object names to aliases as read in from the alias map file.
protected ByteBuffer buffer The buffer containing the instrumentation data.
protected int lvmid The Local Java Virtual Machine Identifier for this buffer.
protected Map<StringMonitor> monitors A Map of monitor objects found in the instrumentation buffer.
Protected Constructors
PerfDataBufferImpl(ByteBuffer buffer, int lvmid)
Constructor.
Public Methods
Monitor findByName(String name)
Find a named Instrumentation object.
List<Monitor> findByPattern(String patternString)
Find all Instrumentation objects with names matching the given pattern.
byte[] getBytes()
Get a copy of the raw instrumentation data.
int getCapacity()
Get the capacity of the instrumentation buffer.
int getLocalVmId()
Get the Local Java Virtual Machine Identifier, or lvmid for the target JVM associated with this instrumentation buffer.
MonitorStatus getMonitorStatus()
Get a list of the inserted and removed monitors since last called.
Protected Methods
abstract void buildMonitorMap(Map<StringMonitor> m)
build the map of Monitor objects.
Monitor findByAlias(String name)
Find the Monitor object for the named counter by using one of its aliases.
abstract MonitorStatus getMonitorStatus(Map<StringMonitor> m)
get the list of inserted and removed monitors since last called.
abstract void getNewMonitors(Map<StringMonitor> m)
get the new Monitor objects from the Map of Monitor objects.
[Expand]
Inherited Methods
From class java.lang.Object

Fields

protected Map aliasCache

A cache of resolved monitor aliases.

protected Map<StringArrayList<String>> aliasMap

A Map of monitor object names to aliases as read in from the alias map file.

protected ByteBuffer buffer

The buffer containing the instrumentation data.

protected int lvmid

The Local Java Virtual Machine Identifier for this buffer.

protected Map<StringMonitor> monitors

A Map of monitor objects found in the instrumentation buffer.

Protected Constructors

protected PerfDataBufferImpl (ByteBuffer buffer, int lvmid)

Constructor.

Parameters
buffer the ByteBuffer containing the instrumentation data.
lvmid the Local Java Virtual Machine Identifier for this instrumentation buffer.

Public Methods

public Monitor findByName (String name)

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. The method will map requests for instrumention objects using old names to their current names, if applicable.

Parameters
name the name of the Instrumentation object to find.
Returns
  • Monitor - the Monitor object that can be used to monitor the the named instrumentation object, or null if the named object doesn't exist.
Throws
MonitorException Thrown if an error occurs while communicating with the target Java Virtual Machine.

public List<Monitor> findByPattern (String patternString)

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.

Parameters
patternString a string containing a pattern as described in Pattern.
Returns
  • List - a List of 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.
Throws
MonitorException Thrown if an error occurs while communicating with the target Java Virtual Machine.
PatternSyntaxException
See Also

public byte[] getBytes ()

Get a copy of the raw instrumentation data. This method is used to get a copy of the current bytes in the instrumentation buffer. It is generally used for transporting those bytes over the network.

Returns
  • byte[] - a copy of the bytes in the instrumentation buffer.

public int getCapacity ()

Get the capacity of the instrumentation buffer.

Returns
  • int - the capacity, or size, of the instrumentation buffer.

public int getLocalVmId ()

Get the Local Java Virtual Machine Identifier, or lvmid for the target JVM associated with this instrumentation buffer.

Returns
  • int - the lvmid

public MonitorStatus getMonitorStatus ()

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

Returns
  • MonitorStatus - the status of available Monitors for the target Java Virtual Machine.
Throws
MonitorException Thrown if communications errors occur while communicating with the target.

Protected Methods

protected abstract void buildMonitorMap (Map<StringMonitor> m)

build the map of Monitor objects.

Parameters
m the map of Monitors.
Throws
MonitorException Thrown if communications errors occur while communicating with the target.

protected Monitor findByAlias (String name)

Find the Monitor object for the named counter by using one of its aliases.

protected abstract MonitorStatus getMonitorStatus (Map<StringMonitor> m)

get the list of inserted and removed monitors since last called.

Parameters
m the map of Monitors.
Throws
MonitorException Thrown if communications errors occur while communicating with the target.

protected abstract void getNewMonitors (Map<StringMonitor> m)

get the new Monitor objects from the Map of Monitor objects.

Parameters
m the map of Monitors.
Throws
MonitorException Thrown if communications errors occur while communicating with the target.