public class

PerfDataFile

extends Object
java.lang.Object
   ↳ sun.jvmstat.perfdata.monitor.protocol.local.PerfDataFile

Class Overview

Class to provide translations from the local Vm Identifier name space into the file system name space and vice-versa.

Provides a factory for creating a File object to the backing store file for instrumentation shared memory region for a JVM identified by its Local Java Virtual Machine Identifier, or lvmid.

See Also

Summary

Constants
String dirNamePrefix The file name prefix for PerfData shared memory files.
String fileNamePattern The file name pattern for PerfData shared memory files.
String tmpFileNamePattern The file name pattern for 1.4.1 PerfData shared memory files.
String userDirNamePattern The directory name pattern for the user directories.
Fields
public static final String tmpDirName The name of the of the system dependent temporary directory
Public Methods
static File getFile(int lvmid)
Get a File object for the instrumentation backing store file for the JVM identified by the given local Vm Identifier.
static File getFile(String user, int lvmid)
Return the File object for the backing store file for the specified Java Virtual Machine.
static int getLocalVmId(File file)
Method to extract a local Java Virtual Machine Identifier from the file name of the given File object.
static String getTempDirectory(String user)
Return the name of the temporary directory to be searched for HotSpot PerfData backing store files for a given user.
static String getTempDirectory()
Return the name of the temporary directory being searched for HotSpot PerfData backing store files.
[Expand]
Inherited Methods
From class java.lang.Object

Constants

public static final String dirNamePrefix

The file name prefix for PerfData shared memory files.

This prefix must be kept in sync with the prefix used by the JVM.

Constant Value: "hsperfdata_"

public static final String fileNamePattern

The file name pattern for PerfData shared memory files.

This pattern must be kept in synch with the file name pattern used by the 1.4.2 and later HotSpot JVM.

Constant Value: "^[0-9]+$"

public static final String tmpFileNamePattern

The file name pattern for 1.4.1 PerfData shared memory files.

This pattern must be kept in synch with the file name pattern used by the 1.4.1 HotSpot JVM.

Constant Value: "^hsperfdata_[0-9]+(_[1-2]+)?$"

public static final String userDirNamePattern

The directory name pattern for the user directories.

Constant Value: "hsperfdata_\S*"

Fields

public static final String tmpDirName

The name of the of the system dependent temporary directory

Public Methods

public static File getFile (int lvmid)

Get a File object for the instrumentation backing store file for the JVM identified by the given local Vm Identifier.

This method looks for the most up to date backing store file for the given lvmid. It will search all the user specific directories in the temporary directory for the host operating system, which may be influenced by platform specific environment variables.

Parameters
lvmid the local Java Virtual Machine Identifier for the target
Returns
  • File - a File object to the backing store file for the named shared memory region of the target JVM.

public static File getFile (String user, int lvmid)

Return the File object for the backing store file for the specified Java Virtual Machine.

This method looks for the most up to date backing store file for the JVM identified by the given user name and lvmid. The directory searched is the temporary directory for the host operating system, which may be influenced by environment variables.

Parameters
user the user name
lvmid the local Java Virtual Machine Identifier for the target
Returns
  • File - a File object to the backing store file for the named shared memory region of the target JVM.

public static int getLocalVmId (File file)

Method to extract a local Java Virtual Machine Identifier from the file name of the given File object.

Parameters
file A File object representing the name of a shared memory region for a target JVM
Returns
  • int - the local Java Virtual Machine Identifier for the target associated with the file
Throws
IllegalArgumentException Thrown if the file name does not conform to the expected pattern

public static String getTempDirectory (String user)

Return the name of the temporary directory to be searched for HotSpot PerfData backing store files for a given user.

This method generally returns the name of a subdirectory of the directory indicated in the java.io.tmpdir property. However, on some platforms it may return a different directory, as the JVM implementation may store the PerfData backing store files in a different directory for performance reasons.

Returns
  • String - the name of the temporary directory.

public static String getTempDirectory ()

Return the name of the temporary directory being searched for HotSpot PerfData backing store files.

This method generally returns the value of the java.io.tmpdir property. However, on some platforms it may return a different directory, as the JVM implementation may store the PerfData backing store files in a different directory for performance reasons.

Returns
  • String - the name of the temporary directory.