public final class SystemUtils extends Object
| Modifier and Type | Method and Description |
|---|---|
static void |
addShutdownHook(String key,
Thread hook)
Add the specified shutdown hook with the specified key.
|
static TypedProperties |
getEnvironment()
Get a map of the environment variables.
|
static TypedProperties |
getNetwork()
Get a map of the environment variables.
|
static int |
getPID()
Return the current process ID.
|
static TypedProperties |
getRuntimeInformation()
Get information about the number of processors available to the JVM and the JVM memory usage.
|
static TypedProperties |
getStorageInformation()
Get storage information about each file system root available on the current host.
|
static TypedProperties |
getSystemProperties()
Return a set of properties guaranteed to always be part of those returned by
System.getProperties(). |
static boolean |
isMac()
Determine whether the current OS is Mac-based.
|
static boolean |
isWindows()
Determine whether the current OS is Windows.
|
static boolean |
isX11()
Determine whether the current OS is X11-based.
|
static long |
maxFreeHeap()
Compute the maximum memory currently available for the Java heap.
|
static void |
removeShutdownHook(String key)
Add the specified shutdown hook with the specified key.
|
public static TypedProperties getSystemProperties()
System.getProperties().TypedProperties instance.public static TypedProperties getRuntimeInformation()
TypedProperties instance holding the requested information.public static TypedProperties getStorageInformation()
TypedProperties object with root name, free space, total space and usable space
information for each root.
If the Java version is before 1.6, only the root name is retrieved. An example root name would be "C:\" for a Windows system and "/" for a Unix system.
public static TypedProperties getEnvironment()
public static TypedProperties getNetwork()
public static long maxFreeHeap()
public static boolean isWindows()
public static boolean isX11()
public static boolean isMac()
public static int getPID()
public static void addShutdownHook(String key, Thread hook)
key - the hokk's key.hook - the shutdown hook to add.public static void removeShutdownHook(String key)
key - the hokk's key.Copyright © 2005-2012 JPPF Team.