APIdia Launch Partner
Top Description Fields Constructors Methods
jdk.jfr.internal

public final Class JVMSupport

extends Object
Class Inheritance
Imports
java.io.IOException, java.time.Instant, .LocalDateTime, jdk.jfr.Recording, jdk.jfr.internal.event.EventConfiguration, jdk.jfr.internal.management.HiddenWait, jdk.jfr.internal.util.Utils, .ValueFormatter

Checks if the running VM supports Flight Recorder. Purpose of this helper class is to detect early and cleanly if the VM has support for Flight Recorder, i.e. not throw UnsatisfiedLinkError in unexpected places.

This is needed so a disabled-jfr.jar can be built for non Oracle JDKs.

Field Summary

Modifier and TypeField and Description
private static Instant
private static volatile boolean
private static final boolean
private static final String

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
private static void
private static boolean
public static boolean
public static void
public static boolean
public static void
public static void
public static void
pack-priv static long
public static synchronized EventConfiguration
getConfiguration(Class<? extends Event> eventClass)

public static boolean
public static boolean
public static String
public static long
nanosToTicks(long nanos)

public static synchronized void
setConfiguration(Class<? extends Event> eventClass, EventConfiguration configuration)

pack-priv static boolean
shouldInstrument(boolean isJDK, String name)

public static void
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

lastTimestampback to summary
private static Instant lastTimestamp
nativeOKback to summary
private static volatile boolean nativeOK
notAvailableback to summary
private static final boolean notAvailable
UNSUPPORTED_VM_MESSAGEback to summary
private static final String UNSUPPORTED_VM_MESSAGE

Constructor Detail

JVMSupportback to summary
public JVMSupport()

Method Detail

awaitUniqueTimestampback to summary
private static void awaitUniqueTimestamp()
checkAvailabilityback to summary
private static boolean checkAvailability()
createFailedNativeJFRback to summary
public static boolean createFailedNativeJFR() throws IllegalStateException
createJFRback to summary
public static void createJFR()
destroyJFRback to summary
public static boolean destroyJFR()
ensureWithIllegalStateExceptionback to summary
public static void ensureWithIllegalStateException()
ensureWithInternalErrorback to summary
public static void ensureWithInternalError()
ensureWithIOExceptionback to summary
public static void ensureWithIOException() throws IOException
getChunkStartNanosback to summary
pack-priv static long getChunkStartNanos()
getConfigurationback to summary
public static synchronized EventConfiguration getConfiguration(Class<? extends Event> eventClass)
hasJFRback to summary
public static boolean hasJFR()
isNotAvailableback to summary
public static boolean isNotAvailable()
makeFilenameback to summary
public static String makeFilename(Recording recording)
nanosToTicksback to summary
public static long nanosToTicks(long nanos)
setConfigurationback to summary
public static synchronized void setConfiguration(Class<? extends Event> eventClass, EventConfiguration configuration)
shouldInstrumentback to summary
pack-priv static boolean shouldInstrument(boolean isJDK, String name)
tryToInitializeJVMback to summary
public static void tryToInitializeJVM()