Jvmstat

sun.jvmstat.perfdata.monitor.protocol.local
Class PerfDataFile

java.lang.Object
  extended by sun.jvmstat.perfdata.monitor.protocol.local.PerfDataFile

public class PerfDataFile
extends Object

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.

Since:
1.5
See Also:
File

Field Summary
static String dirNamePrefix
          The file name prefix for PerfData shared memory files.
static String fileNamePattern
          The file name pattern for PerfData shared memory files.
static String tmpDirName
          The name of the of the system dependent temporary directory
static String tmpFileNamePattern
          The file name pattern for 1.4.1 PerfData shared memory files.
static String userDirNamePattern
          The directory name pattern for the user directories.
 
Method Summary
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()
          Return the name of the temporary directory being searched for HotSpot PerfData backing store files.
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.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

tmpDirName

public static final String tmpDirName
The name of the of the system dependent temporary directory


dirNamePrefix

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.

See Also:
Constant Field Values

userDirNamePattern

public static final String userDirNamePattern
The directory name pattern for the user directories.

See Also:
Constant Field Values

fileNamePattern

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.

See Also:
Constant Field Values

tmpFileNamePattern

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.

See Also:
Constant Field Values
Method Detail

getFile

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.
See Also:
File, getTempDirectory()

getFile

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.
See Also:
File, getTempDirectory()

getLocalVmId

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

getTempDirectory

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.

getTempDirectory

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.

Jvmstat