Jvmstat

sun.jvmstat.monitor
Class MonitoredVmUtil

java.lang.Object
  extended by sun.jvmstat.monitor.MonitoredVmUtil

public class MonitoredVmUtil
extends Object

Utility class proving concenience methods for extracting various information from an MonitoredVm object.

Since:
1.5

Method Summary
static String commandLine(MonitoredVm vm)
          Return the command line for the target Java application.
static boolean isAttachable(MonitoredVm vm)
          Returns true if the VM supports attach-on-demand.
static String jvmArgs(MonitoredVm vm)
          Return the JVM arguments for the target Java application.
static String jvmFlags(MonitoredVm vm)
          Return the JVM flags for the target Java application.
static String mainArgs(MonitoredVm vm)
          Return the arguments to the main class for the target Java application.
static String mainClass(MonitoredVm vm, boolean fullPath)
          Return the main class for the target Java application.
static String vmVersion(MonitoredVm vm)
          Return the Java Virtual Machine Version.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

vmVersion

public static String vmVersion(MonitoredVm vm)
                        throws MonitorException
Return the Java Virtual Machine Version.

Parameters:
vm - the target MonitoredVm
Returns:
String - contains the version of the target JVM or the the string "Unknown" if the version cannot be determined.
Throws:
MonitorException

commandLine

public static String commandLine(MonitoredVm vm)
                          throws MonitorException
Return the command line for the target Java application.

Parameters:
vm - the target MonitoredVm
Returns:
String - contains the command line of the target Java application or the the string "Unknown" if the command line cannot be determined.
Throws:
MonitorException

mainArgs

public static String mainArgs(MonitoredVm vm)
                       throws MonitorException
Return the arguments to the main class for the target Java application. Returns the arguments to the main class. If the arguments can't be found, the string "Unknown" is returned.

Parameters:
vm - the target MonitoredVm
Returns:
String - contains the arguments to the main class for the target Java application or the the string "Unknown" if the command line cannot be determined.
Throws:
MonitorException

mainClass

public static String mainClass(MonitoredVm vm,
                               boolean fullPath)
                        throws MonitorException
Return the main class for the target Java application. Returns the main class or the name of the jar file if the application was started with the -jar option.

Parameters:
vm - the target MonitoredVm
fullPath - include the full path to Jar file, where applicable
Returns:
String - contains the main class of the target Java application or the the string "Unknown" if the command line cannot be determined.
Throws:
MonitorException

jvmArgs

public static String jvmArgs(MonitoredVm vm)
                      throws MonitorException
Return the JVM arguments for the target Java application.

Parameters:
vm - the target MonitoredVm
Returns:
String - contains the arguments passed to the JVM for the target Java application or the the string "Unknown" if the command line cannot be determined.
Throws:
MonitorException

jvmFlags

public static String jvmFlags(MonitoredVm vm)
                       throws MonitorException
Return the JVM flags for the target Java application.

Parameters:
vm - the target MonitoredVm
Returns:
String - contains the flags passed to the JVM for the target Java application or the the string "Unknown" if the command line cannot be determined.
Throws:
MonitorException

isAttachable

public static boolean isAttachable(MonitoredVm vm)
                            throws MonitorException
Returns true if the VM supports attach-on-demand.

Parameters:
vm - the target MonitoredVm
Throws:
MonitorException

Jvmstat