public enum Jvm extends Enum<Jvm>
Modifier and Type | Method and Description |
---|---|
static boolean |
areOptionalSafepointsEnabled() |
static void |
busyWaitMicros(long micros)
This method is designed to be used when the time to be
waited is very small, typically under a millisecond.
|
static void |
busyWaitUntil(long waitUntil)
This method is designed to be used when the time to be
waited is very small, typically under a millisecond.
|
static ClassMetrics |
classMetrics(Class c) |
static int |
compileThreshold() |
static @NotNull ExceptionHandler |
debug() |
static void |
disableDebugHandler() |
static boolean |
dontChain(Class tClass) |
static void |
dumpException(@NotNull Map<ExceptionKey,Integer> exceptions) |
static @NotNull ExceptionHandler |
fatal() |
static Field |
getField(@NotNull Class clazz,
@NotNull String name)
Get the Field for a class by name.
|
static Method |
getMethod(@NotNull Class clazz,
@NotNull String name,
Class... args) |
static int |
getProcessId() |
static <V> V |
getValue(@NotNull Object obj,
@NotNull String name) |
static boolean |
hasException(@NotNull Map<ExceptionKey,Integer> exceptions) |
static void |
init() |
static boolean |
is64bit() |
static boolean |
isArm() |
static boolean |
isDebug() |
static boolean |
isDebugEnabled(Class aClass) |
static boolean |
isFlightRecorder() |
static boolean |
isJava12Plus() |
static boolean |
isJava14Plus() |
static boolean |
isJava9Plus() |
static String |
lockWithStack(@NotNull ReentrantLock lock)
Log the stack trace of the thread holding a lock.
|
static int |
majorVersion() |
static long |
maxDirectMemory() |
static void |
nanoPause()
Pause in a busy loop for a very short time.
|
static void |
optionalSafepoint() |
static void |
pause(long millis)
Silently pause for milli seconds.
|
static @NotNull ExceptionHandler |
perf() |
static @NotNull Map<ExceptionKey,Integer> |
recordExceptions() |
static @NotNull Map<ExceptionKey,Integer> |
recordExceptions(boolean debug) |
static @NotNull Map<ExceptionKey,Integer> |
recordExceptions(boolean debug,
boolean exceptionsOnly) |
static @NotNull Map<ExceptionKey,Integer> |
recordExceptions(boolean debug,
boolean exceptionsOnly,
boolean logToSlf4j) |
static void |
resetExceptionHandlers() |
static <T extends Throwable> |
rethrow(Throwable throwable)
Cast a CheckedException as an unchecked one.
|
static void |
safepoint() |
static void |
setAccessible(AccessibleObject h) |
static void |
setExceptionHandlers(@Nullable ExceptionHandler fatal,
@Nullable ExceptionHandler warn,
@Nullable ExceptionHandler debug) |
static void |
setExceptionHandlers(@Nullable ExceptionHandler fatal,
@Nullable ExceptionHandler warn,
@Nullable ExceptionHandler debug,
@Nullable ExceptionHandler perf) |
static void |
setExceptionsHandlers(@Nullable ExceptionHandler fatal,
@Nullable ExceptionHandler warn,
@Nullable ExceptionHandler debug)
Deprecated.
|
static void |
setThreadLocalExceptionHandlers(@Nullable ExceptionHandler fatal,
@Nullable ExceptionHandler warn,
@Nullable ExceptionHandler debug) |
static void |
setThreadLocalExceptionHandlers(@Nullable ExceptionHandler fatal,
@Nullable ExceptionHandler warn,
@Nullable ExceptionHandler debug,
@Nullable ExceptionHandler perf) |
static void |
signalHandler(sun.misc.SignalHandler signalHandler)
Helper method for setting the default signals.
|
static boolean |
stackTraceEndsWith(String endsWith,
int n) |
static int |
trimLast(int first,
@NotNull StackTraceElement[] stes) |
static void |
trimStackTrace(@NotNull StringBuilder sb,
StackTraceElement... stes)
Append the StackTraceElements to the StringBuilder trimming some internal methods.
|
static long |
usedDirectMemory() |
static long |
usedNativeMemory() |
static String |
userHome() |
static Jvm |
valueOf(String name)
Returns the enum constant of this type with the specified name.
|
static Jvm[] |
values()
Returns an array containing the constants of this enum type, in
the order they are declared.
|
static @NotNull ExceptionHandler |
warn() |
public static Jvm[] values()
for (Jvm c : Jvm.values()) System.out.println(c);
public static Jvm valueOf(String name)
name
- the name of the enum constant to be returned.IllegalArgumentException
- if this enum type has no constant with the specified nameNullPointerException
- if the argument is nullpublic static void init()
public static int compileThreshold()
public static int majorVersion()
public static boolean isJava9Plus()
public static boolean isJava12Plus()
public static boolean isJava14Plus()
public static int getProcessId()
@NotNull public static <T extends Throwable> @NotNull RuntimeException rethrow(Throwable throwable) throws T extends Throwable
T
- the type of the Throwablethrowable
- to castT
- the throwable as an unchecked throwableT extends Throwable
public static void trimStackTrace(@NotNull @NotNull StringBuilder sb, @NotNull StackTraceElement... stes)
sb
- to append tostes
- stack trace elementspublic static int trimLast(int first, @NotNull @NotNull StackTraceElement[] stes)
public static boolean isDebug()
public static boolean isFlightRecorder()
public static void pause(long millis)
millis
- to sleep for.public static void nanoPause()
public static void busyWaitMicros(long micros)
micros
- Time in microspublic static void busyWaitUntil(long waitUntil)
waitUntil
- nanosecond precision counter value to await.public static Field getField(@NotNull @NotNull Class clazz, @NotNull @NotNull String name)
clazz
- to get the field forname
- of the fieldpublic static Method getMethod(@NotNull @NotNull Class clazz, @NotNull @NotNull String name, Class... args)
public static void setAccessible(AccessibleObject h)
public static String lockWithStack(@NotNull @NotNull ReentrantLock lock)
lock
- to logpublic static long usedDirectMemory()
public static long usedNativeMemory()
public static long maxDirectMemory()
public static boolean is64bit()
public static void resetExceptionHandlers()
public static void disableDebugHandler()
@NotNull public static @NotNull Map<ExceptionKey,Integer> recordExceptions()
@NotNull public static @NotNull Map<ExceptionKey,Integer> recordExceptions(boolean debug)
@NotNull public static @NotNull Map<ExceptionKey,Integer> recordExceptions(boolean debug, boolean exceptionsOnly)
@NotNull public static @NotNull Map<ExceptionKey,Integer> recordExceptions(boolean debug, boolean exceptionsOnly, boolean logToSlf4j)
public static boolean hasException(@NotNull @NotNull Map<ExceptionKey,Integer> exceptions)
@Deprecated public static void setExceptionsHandlers(@Nullable @Nullable ExceptionHandler fatal, @Nullable @Nullable ExceptionHandler warn, @Nullable @Nullable ExceptionHandler debug)
public static void setExceptionHandlers(@Nullable @Nullable ExceptionHandler fatal, @Nullable @Nullable ExceptionHandler warn, @Nullable @Nullable ExceptionHandler debug)
public static void setExceptionHandlers(@Nullable @Nullable ExceptionHandler fatal, @Nullable @Nullable ExceptionHandler warn, @Nullable @Nullable ExceptionHandler debug, @Nullable @Nullable ExceptionHandler perf)
public static void setThreadLocalExceptionHandlers(@Nullable @Nullable ExceptionHandler fatal, @Nullable @Nullable ExceptionHandler warn, @Nullable @Nullable ExceptionHandler debug)
public static void setThreadLocalExceptionHandlers(@Nullable @Nullable ExceptionHandler fatal, @Nullable @Nullable ExceptionHandler warn, @Nullable @Nullable ExceptionHandler debug, @Nullable @Nullable ExceptionHandler perf)
@NotNull public static @NotNull ExceptionHandler fatal()
@NotNull public static @NotNull ExceptionHandler warn()
@NotNull public static @NotNull ExceptionHandler perf()
@NotNull public static @NotNull ExceptionHandler debug()
public static void dumpException(@NotNull @NotNull Map<ExceptionKey,Integer> exceptions)
public static boolean isDebugEnabled(Class aClass)
public static void signalHandler(sun.misc.SignalHandler signalHandler)
signalHandler
- to call on a signalpublic static void safepoint()
public static void optionalSafepoint()
public static boolean areOptionalSafepointsEnabled()
public static boolean stackTraceEndsWith(String endsWith, int n)
public static boolean isArm()
public static ClassMetrics classMetrics(Class c) throws IllegalArgumentException
IllegalArgumentException
public static String userHome()
public static boolean dontChain(Class tClass)
Copyright © 2020. All rights reserved.