public static class BTraceUtils.Sys.Env
extends java.lang.Object
Constructor and Description |
---|
Env() |
Modifier and Type | Method and Description |
---|---|
static long |
availableProcessors()
Returns the number of processors available to the Java virtual machine.
|
static java.util.Map<java.lang.String,java.lang.String> |
getenv()
Returns an unmodifiable string map view of the current system environment.
|
static java.lang.String |
getenv(java.lang.String name)
Gets the value of the specified environment variable.
|
static void |
printEnv()
Prints all system environment values.
|
static void |
printProperties()
Prints all Sys properties.
|
static java.util.Properties |
properties()
Returns all Sys properties.
|
static java.lang.String |
property(java.lang.String key)
Gets the system property indicated by the specified key.
|
public static java.lang.String property(java.lang.String key)
key
- the name of the system property.null
if there is no property with that key.java.lang.NullPointerException
- if key
is
null
.java.lang.IllegalArgumentException
- if key
is empty.public static java.util.Properties properties()
public static void printProperties()
public static java.lang.String getenv(java.lang.String name)
name
- the name of the environment variablenull
if the variable is not defined in the system environmentjava.lang.NullPointerException
- if name
is null
public static java.util.Map<java.lang.String,java.lang.String> getenv()
public static void printEnv()
public static long availableProcessors()
This value may change during a particular invocation of the virtual machine. Applications that are sensitive to the number of available processors should therefore occasionally poll this property and adjust their resource usage appropriately.