com.sun.btrace
Class BTraceUtils.Sys.Env

java.lang.Object
  extended by com.sun.btrace.BTraceUtils.Sys.Env
Enclosing class:
BTraceUtils.Sys

public static class BTraceUtils.Sys.Env
extends java.lang.Object


Constructor Summary
BTraceUtils.Sys.Env()
           
 
Method Summary
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.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BTraceUtils.Sys.Env

public BTraceUtils.Sys.Env()
Method Detail

property

public static java.lang.String property(java.lang.String key)
Gets the system property indicated by the specified key.

Parameters:
key - the name of the system property.
Returns:
the string value of the system property, or null if there is no property with that key.
Throws:
java.lang.NullPointerException - if key is null.
java.lang.IllegalArgumentException - if key is empty.

properties

public static java.util.Properties properties()
Returns all Sys properties.

Returns:
the system properties

printProperties

public static void printProperties()
Prints all Sys properties.


getenv

public static java.lang.String getenv(java.lang.String name)
Gets the value of the specified environment variable. An environment variable is a system-dependent external named value.

Parameters:
name - the name of the environment variable
Returns:
the string value of the variable, or null if the variable is not defined in the system environment
Throws:
java.lang.NullPointerException - if name is null

getenv

public static java.util.Map<java.lang.String,java.lang.String> getenv()
Returns an unmodifiable string map view of the current system environment. The environment is a system-dependent mapping from names to values which is passed from parent to child processes.

Returns:
the environment as a map of variable names to values

printEnv

public static void printEnv()
Prints all system environment values.


availableProcessors

public static long availableProcessors()
Returns the number of processors available to the Java virtual machine.

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.

Returns:
the maximum number of processors available to the virtual machine; never smaller than one