Package org.openjdk.jmc.agent.util
Class VersionUtils
- java.lang.Object
-
- org.openjdk.jmc.agent.util.VersionUtils
-
public final class VersionUtils extends java.lang.Object
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
VersionUtils.JFRVersion
-
Field Summary
Fields Modifier and Type Field Description private static VersionUtils.JFRVersion
AVAILABLE_JFR_VERSION
private static int
FEATURE_VERSION
-
Constructor Summary
Constructors Modifier Constructor Description private
VersionUtils()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description private static int
determineFeatureVersion()
private static VersionUtils.JFRVersion
determineJFRVersion()
static VersionUtils.JFRVersion
getAvailableJFRVersion()
Returns the current JVM's JFR version.static java.util.OptionalInt
getFeatureVersion()
Returns the current JVM's feature (major) version, e.g.private static java.lang.reflect.Method
getMethod(java.lang.Class<?> clazz, java.lang.String methodName)
-
-
-
Field Detail
-
AVAILABLE_JFR_VERSION
private static final VersionUtils.JFRVersion AVAILABLE_JFR_VERSION
-
FEATURE_VERSION
private static final int FEATURE_VERSION
-
-
Method Detail
-
determineJFRVersion
private static VersionUtils.JFRVersion determineJFRVersion()
-
getAvailableJFRVersion
public static VersionUtils.JFRVersion getAvailableJFRVersion()
Returns the current JVM's JFR version.
-
getFeatureVersion
public static java.util.OptionalInt getFeatureVersion()
Returns the current JVM's feature (major) version, e.g. 8, 11, or 15.
-
determineFeatureVersion
private static int determineFeatureVersion()
-
getMethod
private static java.lang.reflect.Method getMethod(java.lang.Class<?> clazz, java.lang.String methodName) throws java.lang.Exception
- Throws:
java.lang.Exception
-
-