Package adams.core.management
Class JConsole
- java.lang.Object
-
- adams.core.management.Java
-
- adams.core.management.JConsole
-
public class JConsole extends Java
A helper class for the jconsole utility.- Version:
- $Revision$
- Author:
- fracpete (fracpete at waikato dot ac dot nz)
-
-
Field Summary
Fields Modifier and Type Field Description static String
EXECUTABLE
the jconsole executable.-
Fields inherited from class adams.core.management.Java
BIN_DIR, CLASSPATH_FULL, CLASSPATH_SHORT, JAVA, JAVAC, MAJOR_VERSION
-
-
Constructor Summary
Constructors Constructor Description JConsole()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static String
execute(long pid)
Executes jconsole with default options and returns the output.static String
execute(String options, long pid)
Executes jconsole with default options and returns the output.static String
execute(String executable, String options, long pid)
Executes jconsole and returns the output.static String
getDefaultOptions()
Returns the default options ("-histo:live") for jmap.static String
getExecutablePath()
Returns the full path of the JConsole executable, if possible.static boolean
isAvailable()
Checks whether jconsole is available at all.-
Methods inherited from class adams.core.management.Java
canStopThread, execute, getBinDir, getBinDir, getClassPath, getHome, getJavaExecutable, getMajorVersion, isJDK, isJDK, isJRE, isJRE, main
-
-
-
-
Field Detail
-
EXECUTABLE
public static final String EXECUTABLE
the jconsole executable.- See Also:
- Constant Field Values
-
-
Method Detail
-
isAvailable
public static boolean isAvailable()
Checks whether jconsole is available at all.- Returns:
- true if available
-
getExecutablePath
public static String getExecutablePath()
Returns the full path of the JConsole executable, if possible.- Returns:
- the full path of the executable if possible, otherwise just the executable
-
getDefaultOptions
public static String getDefaultOptions()
Returns the default options ("-histo:live") for jmap.- Returns:
- the default options
-
execute
public static String execute(long pid)
Executes jconsole with default options and returns the output.- Parameters:
pid
- the process ID of the JVM to connect to, gets determined automatically if AUTO_PID- Returns:
- the output
- See Also:
getDefaultOptions()
,Java#AUTO_PID
-
execute
public static String execute(String options, long pid)
Executes jconsole with default options and returns the output.- Parameters:
options
- additional options for jconsolepid
- the process ID of the JVM to connect to, gets determined automatically if AUTO_PID- Returns:
- the output
- See Also:
getDefaultOptions()
,Java#AUTO_PID
-
execute
public static String execute(String executable, String options, long pid)
Executes jconsole and returns the output.- Parameters:
executable
- the jconsole executable to useoptions
- additional options for jconsolepid
- the process ID of the JVM to connect to, gets determined automatically if AUTO_PID- Returns:
- the output, if any
- See Also:
Java#AUTO_PID
-
-