public final class Runtime extends Object
Modifier and Type | Class and Description |
---|---|
static class |
Runtime.Jmx |
static interface |
Runtime.ProcOutputHandler
Deprecated.
use Processhandler
|
static class |
Runtime.Version |
Modifier and Type | Field and Description |
---|---|
static boolean |
IS_LITTLE_ENDIAN |
static String |
JAVA_HOME |
static Runtime.Version |
JAVA_PLATFORM |
static String |
JAVA_VERSION |
static int |
NR_PROCESSORS |
static String |
OS_NAME |
static int |
PID
Unix PID identifying your process in the OC image it is running.
|
static String |
PROCESS_ID
a unique ID for this JVM process.
|
static String |
PROCESS_NAME |
static String |
TMP_FOLDER |
static String |
USER_DIR |
static String |
USER_HOME |
static String |
USER_NAME |
static long |
WAIT_FOR_SHUTDOWN_NANOS |
Modifier and Type | Method and Description |
---|---|
static void |
error(String message) |
static void |
error(String message,
Throwable t) |
static boolean |
gc(long timeoutMillis)
Attempts to run the GC in a verifiable way.
|
static long |
getDeadline()
Deprecated.
see ExecutionContexts.
|
static CharSequence |
getLsofOutput()
Deprecated.
use Lsof.getLsofOutput instead.
|
static Class<?> |
getMainClass() |
static Thread |
getMainThread()
get the main Thread.
|
static int |
getNrOpenFiles()
Deprecated.
use OperatingSystem.getOpenFileDescriptorCount() instead
|
static void |
goDownWithError(SysExits exitCode) |
static void |
goDownWithError(Throwable t,
int exitCode) |
static void |
goDownWithError(Throwable t,
SysExits exitCode) |
static boolean |
haveJnaPlatform() |
static boolean |
haveJnaPlatformClib() |
static boolean |
isMacOsx() |
static boolean |
isTestFramework() |
static boolean |
isWindows() |
static CharSequence |
jrun(Class<?> classWithMain,
long timeoutMillis,
String... arguments) |
static CharSequence |
jrun(Class<?> classWithMain,
String classPath,
long timeoutMillis,
String... arguments) |
static CharSequence |
jrun(Class<?> classWithMain,
String classPath,
long timeoutMillis,
String[] jvmArgs,
String... arguments) |
static void |
jrunAndLog(Class<?> classWithMain,
long timeoutMillis,
String... arguments) |
static void |
jrunAndLog(Class<?> classWithMain,
String classPath,
long timeoutMillis,
String... arguments) |
static void |
jrunAndLog(Class<?> classWithMain,
String classPath,
long timeoutMillis,
String[] jvmArgs,
String... arguments) |
static int |
killProcess(Process proc,
long terminateTimeoutMillis,
long forceTerminateTimeoutMillis)
Deprecated.
use OperatingSystem.killProcess.
|
static long |
millisToDeadline()
Deprecated.
see ExecutionContexts.
|
static void |
queueHook(int priority,
Runnable runnable) |
static void |
queueHookAtBeginning(Runnable runnable) |
static void |
queueHookAtEnd(Runnable runnable) |
static boolean |
removeQueuedShutdownHook(Runnable runnable) |
static CharSequence |
run(String[] command,
long timeoutMillis)
Deprecated.
use OperatingSystem.forkExec.
|
static int |
run(String[] command,
Runtime.ProcOutputHandler handler,
long timeoutMillis)
Deprecated.
use OperatingSystem.forkExec instead.
|
static int |
run(String[] command,
Runtime.ProcOutputHandler handler,
long timeoutMillis,
long terminationTimeoutMillis)
Deprecated.
use OperatingSystem.forkExec instead.
|
public static final boolean IS_LITTLE_ENDIAN
public static final long WAIT_FOR_SHUTDOWN_NANOS
public static final String TMP_FOLDER
public static final String JAVA_VERSION
public static final String USER_NAME
public static final String USER_DIR
public static final String USER_HOME
public static final String JAVA_HOME
public static final int PID
public static final String OS_NAME
public static final String PROCESS_NAME
public static final String PROCESS_ID
public static final int NR_PROCESSORS
public static final Runtime.Version JAVA_PLATFORM
public static void error(String message)
public static void goDownWithError(SysExits exitCode)
public static boolean isMacOsx()
public static boolean isWindows()
public static boolean isTestFramework()
public static boolean haveJnaPlatform()
public static boolean haveJnaPlatformClib()
@CheckReturnValue @Deprecated public static int getNrOpenFiles()
@Nullable @CheckReturnValue @Deprecated public static CharSequence getLsofOutput()
@Deprecated public static CharSequence run(String[] command, long timeoutMillis) throws IOException, InterruptedException, ExecutionException, TimeoutException
@Deprecated public static int killProcess(Process proc, long terminateTimeoutMillis, long forceTerminateTimeoutMillis) throws InterruptedException, TimeoutException
InterruptedException
TimeoutException
public static int run(String[] command, Runtime.ProcOutputHandler handler, long timeoutMillis) throws IOException, InterruptedException, ExecutionException, TimeoutException
@Deprecated public static int run(String[] command, Runtime.ProcOutputHandler handler, long timeoutMillis, long terminationTimeoutMillis) throws IOException, InterruptedException, ExecutionException, TimeoutException
public static void queueHookAtBeginning(Runnable runnable)
public static void queueHookAtEnd(Runnable runnable)
public static void queueHook(int priority, Runnable runnable)
public static boolean removeQueuedShutdownHook(Runnable runnable)
@Deprecated public static long getDeadline()
@Deprecated public static long millisToDeadline() throws TimeoutException
TimeoutException
public static boolean gc(long timeoutMillis)
timeoutMillis
- - timeout for GC attemptpublic static CharSequence jrun(Class<?> classWithMain, long timeoutMillis, String... arguments) throws IOException, InterruptedException, ExecutionException, TimeoutException
public static CharSequence jrun(Class<?> classWithMain, String classPath, long timeoutMillis, String... arguments) throws InterruptedException, ExecutionException, TimeoutException, IOException
public static CharSequence jrun(Class<?> classWithMain, String classPath, long timeoutMillis, String[] jvmArgs, String... arguments) throws InterruptedException, ExecutionException, TimeoutException, IOException
public static void jrunAndLog(Class<?> classWithMain, long timeoutMillis, String... arguments) throws IOException, InterruptedException, ExecutionException, TimeoutException
public static void jrunAndLog(Class<?> classWithMain, String classPath, long timeoutMillis, String... arguments) throws InterruptedException, ExecutionException, TimeoutException, IOException
public static void jrunAndLog(Class<?> classWithMain, String classPath, long timeoutMillis, String[] jvmArgs, String... arguments) throws InterruptedException, ExecutionException, TimeoutException, IOException
@Nullable public static Thread getMainThread()
Copyright © 2018 SPF4J. All rights reserved.