Jvmstat

sun.jvmstat.perfdata.monitor
Class AbstractPerfDataBufferPrologue

java.lang.Object
  extended by sun.jvmstat.perfdata.monitor.AbstractPerfDataBufferPrologue
Direct Known Subclasses:
PerfDataBufferPrologue

public abstract class AbstractPerfDataBufferPrologue
extends Object

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
 

Since:
1.5

Field Summary
protected  ByteBuffer byteBuffer
           
static String PERFDATA_MAJOR_NAME
           
static String PERFDATA_MINOR_NAME
           
 
Constructor Summary
AbstractPerfDataBufferPrologue(ByteBuffer byteBuffer)
          Construct a PerfDataBufferPrologue instance.
 
Method Summary
 ByteOrder getByteOrder()
          Get the byte order.
static ByteOrder getByteOrder(ByteBuffer bb)
          Get the byte order for the given ByteBuffer.
 int getMagic()
          Get the magic number.
static int getMagic(ByteBuffer bb)
          Get the magic number from the given byteBuffer.
 int getMajorVersion()
          Get the major version.
static int getMajorVersion(ByteBuffer bb)
          Get the major version number from the given ByteBuffer.
 int getMinorVersion()
          Get the minor version.
static int getMinorVersion(ByteBuffer bb)
          Get the minor version number from the given ByteBuffer.
 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.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

byteBuffer

protected ByteBuffer byteBuffer

PERFDATA_MAJOR_NAME

public static final String PERFDATA_MAJOR_NAME
See Also:
Constant Field Values

PERFDATA_MINOR_NAME

public static final String PERFDATA_MINOR_NAME
See Also:
Constant Field Values
Constructor Detail

AbstractPerfDataBufferPrologue

public AbstractPerfDataBufferPrologue(ByteBuffer byteBuffer)
                               throws MonitorException
Construct a PerfDataBufferPrologue instance.

Parameters:
byteBuffer - buffer containing the instrumentation data
Throws:
MonitorException
Method Detail

getMagic

public int getMagic()
Get the magic number.

Returns:
int - the magic number

getByteOrder

public ByteOrder getByteOrder()
Get the byte order.

Returns:
int - the byte order of the instrumentation buffer

getMajorVersion

public int getMajorVersion()
Get the major version.

Returns:
int - the major version

getMinorVersion

public int getMinorVersion()
Get the minor version.

Returns:
int - the minor version

isAccessible

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
See Also:
supportsAccessible()

supportsAccessible

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:
isAccessible()

getSize

public int getSize()
Get the size of the header portion of the instrumentation buffer.

Returns:
int - the size of the header

majorVersionBuffer

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.

minorVersionBuffer

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.

getMagic

public static int getMagic(ByteBuffer bb)
Get the magic number from the given byteBuffer.

Returns:
int - the magic number

getMajorVersion

public static int getMajorVersion(ByteBuffer bb)
Get the major version number from the given ByteBuffer.

Returns:
int - the major version

getMinorVersion

public static int getMinorVersion(ByteBuffer bb)
Get the minor version number from the given ByteBuffer.

Returns:
int - the minor version

getByteOrder

public static ByteOrder getByteOrder(ByteBuffer bb)
Get the byte order for the given ByteBuffer.

Returns:
int - the byte order of the instrumentation buffer

Jvmstat