public abstract class

AbstractPerfDataBufferPrologue

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

Class Overview

Abstraction representing the HotSpot PerfData instrumentation buffer header. This class represents only the fixed portion of the header. Version specific classes represent the portion of the header that may change from release to release.

The PerfDataBufferProlog class supports parsing of the following C structure:

 typedef struct {
   jint magic;             // magic number - 0xcafec0c0
   jbyte byte_order;       // byte order of the buffer
   jbyte major_version;    // major and minor version numbers
   jbyte minor_version;
   jbyte reserved_byte1;   // reserved - see concrete implementations for
                           // possible definition.
   ...                     // remainder is handled by the subclasses.
 } PerfDataPrologue
 

Summary

Constants
String PERFDATA_MAJOR_NAME
String PERFDATA_MINOR_NAME
Fields
protected ByteBuffer byteBuffer
Public Constructors
AbstractPerfDataBufferPrologue(ByteBuffer byteBuffer)
Construct a PerfDataBufferPrologue instance.
Public Methods
ByteOrder getByteOrder()
Get the byte order.
static ByteOrder getByteOrder(ByteBuffer bb)
Get the byte order for the given ByteBuffer.
static int getMagic(ByteBuffer bb)
Get the magic number from the given byteBuffer.
int getMagic()
Get the magic number.
int getMajorVersion()
Get the major version.
static int getMajorVersion(ByteBuffer bb)
Get the major version number from the given ByteBuffer.
static int getMinorVersion(ByteBuffer bb)
Get the minor version number from the given ByteBuffer.
int getMinorVersion()
Get the minor version.
int getSize()
Get the size of the header portion of the instrumentation buffer.
abstract boolean isAccessible()
Get the accessible flag.
IntBuffer majorVersionBuffer()
Return an IntBuffer that accesses the major version number.
IntBuffer minorVersionBuffer()
Return an IntBuffer that accesses the minor version number.
abstract boolean supportsAccessible()
Test if the accessible flag is supported by this version of the PerfDataBufferPrologue.
[Expand]
Inherited Methods
From class java.lang.Object

Constants

public static final String PERFDATA_MAJOR_NAME

Constant Value: "sun.perfdata.majorVersion"

public static final String PERFDATA_MINOR_NAME

Constant Value: "sun.perfdata.minorVersion"

Fields

protected ByteBuffer byteBuffer

Public Constructors

public AbstractPerfDataBufferPrologue (ByteBuffer byteBuffer)

Construct a PerfDataBufferPrologue instance.

Parameters
byteBuffer buffer containing the instrumentation data

Public Methods

public ByteOrder getByteOrder ()

Get the byte order.

Returns
  • int - the byte order of the instrumentation buffer

public static ByteOrder getByteOrder (ByteBuffer bb)

Get the byte order for the given ByteBuffer.

Returns
  • int - the byte order of the instrumentation buffer

public static int getMagic (ByteBuffer bb)

Get the magic number from the given byteBuffer.

Returns
  • int - the magic number

public int getMagic ()

Get the magic number.

Returns
  • int - the magic number

public int getMajorVersion ()

Get the major version.

Returns
  • int - the major version

public static int getMajorVersion (ByteBuffer bb)

Get the major version number from the given ByteBuffer.

Returns
  • int - the major version

public static int getMinorVersion (ByteBuffer bb)

Get the minor version number from the given ByteBuffer.

Returns
  • int - the minor version

public int getMinorVersion ()

Get the minor version.

Returns
  • int - the minor version

public int getSize ()

Get the size of the header portion of the instrumentation buffer.

Returns
  • int - the size of the header

public abstract boolean isAccessible ()

Get the accessible flag. If supported, it indicates that the shared memory region is sufficiently initialized for client acccess.

Returns
  • boolean - the initialized status

public IntBuffer majorVersionBuffer ()

Return an IntBuffer that accesses the major version number. This is used to create a Monitor object for this value.

Returns
  • IntBuffer - a ByteBuffer that accesses the major version number in the instrumentation buffer header.

public IntBuffer minorVersionBuffer ()

Return an IntBuffer that accesses the minor version number. This is used to create a Monitor object for this value.

Returns
  • IntBuffer - a ByteBuffer that accesses the minor version number in the instrumentation buffer header.

public abstract boolean supportsAccessible ()

Test if the accessible flag is supported by this version of the PerfDataBufferPrologue. Although not an abstract method, this method should be overridden by version specific subclasses.

Returns
  • boolean - the initialized flag support status.
See Also