Top Description Fields Constructors Methods
sun.jvmstat.perfdata.monitor

public abstract Class PerfDataBufferImpl

extends Object
Class Inheritance
Known Direct Subclasses
sun.jvmstat.perfdata.monitor.v1_0.PerfDataBuffer, sun.jvmstat.perfdata.monitor.v2_0.PerfDataBuffer
Imports
sun.jvmstat.monitor.*, java.util.*, java.nio.*, java.io.*, java.net.*, java.util.regex.*

The base classes for the concrete implementations of the HotSpot PerfData instrumentation buffer.
Author
Brian Doherty
Since
1.5
See Also
AbstractPerfDataBuffer

Field Summary

Modifier and TypeField and Description
protected Map<String, Monitor>
aliasCache

A cache of resolved monitor aliases.

protected Map<String, ArrayList<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<String, Monitor>
monitors

A Map of monitor objects found in the instrumentation buffer.

Constructor Summary

AccessConstructor and Description
protected
PerfDataBufferImpl(ByteBuffer
the ByteBuffer containing the instrumentation data.
buffer
,
int
the Local Java Virtual Machine Identifier for this instrumentation buffer.
lvmid
)

Constructor.

Method Summary

Modifier and TypeMethod and Description
private void
buildAliasMap()

Build the alias mapping.

protected abstract void
buildMonitorMap(Map<String, Monitor>
the map of Monitors.
m
)

build the map of Monitor objects.

protected Monitor
findByAlias(String name)

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

public Monitor

Returns:

Monitor - the Monitor object that can be used to monitor the named instrumentation object, or null if the named object doesn't exist.
findByName
(String
the name of the Instrumentation object to find.
name
)

Find a named Instrumentation object.

public List<Monitor>

Returns:

List<Monitor> - 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.
findByPattern
(String
a string containing a pattern as described in java.util.regex.Pattern.
patternString
)

Find all Instrumentation objects with names matching the given pattern.

pack-priv ByteBuffer

Returns:

ByteBuffer - a ByteBuffer object that refers to the instrumentation data.
getByteBuffer
()

Get the ByteBuffer containing the instrumentation data.

public byte[]

Returns:

byte[] - a copy of the bytes in the instrumentation buffer.
getBytes
()

Get a copy of the raw instrumentation data.

public int

Returns:

int - the capacity, or size, of the instrumentation buffer.
getCapacity
()

Get the capacity of the instrumentation buffer.

public int

Returns:

int - the lvmid
getLocalVmId
()

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

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.

protected abstract MonitorStatus
getMonitorStatus(Map<String, Monitor>
the map of Monitors.
m
)

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

protected abstract void
getNewMonitors(Map<String, Monitor>
the map of Monitors.
m
)

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

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

aliasCacheback to summary
protected Map<String, Monitor> aliasCache

A cache of resolved monitor aliases.

aliasMapback to summary
protected Map<String, ArrayList<String>> aliasMap

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

bufferback to summary
protected ByteBuffer buffer

The buffer containing the instrumentation data.

lvmidback to summary
protected int lvmid

The Local Java Virtual Machine Identifier for this buffer.

monitorsback to summary
protected Map<String, Monitor> monitors

A Map of monitor objects found in the instrumentation buffer.

Constructor Detail

PerfDataBufferImplback to summary
protected PerfDataBufferImpl(ByteBuffer buffer, int lvmid)

Constructor.

Parameters
buffer:ByteBuffer

the ByteBuffer containing the instrumentation data.

lvmid:int

the Local Java Virtual Machine Identifier for this instrumentation buffer.

Method Detail

buildAliasMapback to summary
private void buildAliasMap()

Build the alias mapping. Uses the default alias map file unless the sun.jvmstat.perfdata.aliasmap file indicates some other file as the source.

Annotations
@SuppressWarnings:deprecation
buildMonitorMapback to summary
protected abstract void buildMonitorMap(Map<String, Monitor> m) throws MonitorException

build the map of Monitor objects.

Parameters
m:Map<String, Monitor>

the map of Monitors.

Exceptions
MonitorException:
Thrown if communications errors occur while communicating with the target.
findByAliasback to summary
protected Monitor findByAlias(String name)

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

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

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:String

the name of the Instrumentation object to find.

Returns:Monitor

Monitor - the Monitor object that can be used to monitor the named instrumentation object, or null if the named object doesn't exist.

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, PatternSyntaxException

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:String

a string containing a pattern as described in java.util.regex.Pattern.

Returns:List<Monitor>

List<Monitor> - 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.

Exceptions
MonitorException:
Thrown if an error occurs while communicating with the target Java Virtual Machine.
See Also
java.util.regex.Pattern
getByteBufferback to summary
pack-priv ByteBuffer getByteBuffer()

Get the ByteBuffer containing the instrumentation data.

Returns:ByteBuffer

ByteBuffer - a ByteBuffer object that refers to the instrumentation data.

getBytesback to summary
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[]

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

getCapacityback to summary
public int getCapacity()

Get the capacity of the instrumentation buffer.

Returns:int

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

getLocalVmIdback to summary
public int getLocalVmId()

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

Returns:int

int - the lvmid

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.
getMonitorStatusback to summary
protected abstract MonitorStatus getMonitorStatus(Map<String, Monitor> m) throws MonitorException

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

Parameters
m:Map<String, Monitor>

the map of Monitors.

Exceptions
MonitorException:
Thrown if communications errors occur while communicating with the target.
getNewMonitorsback to summary
protected abstract void getNewMonitors(Map<String, Monitor> m) throws MonitorException

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

Parameters
m:Map<String, Monitor>

the map of Monitors.

Exceptions
MonitorException:
Thrown if communications errors occur while communicating with the target.