Main Page | Modules | Class Hierarchy | Class List | Directories | File List | Class Members | Related Pages

xmog_java_lang_System Class Reference

A utility class that exposes some system/runtime functions to C++. More...

#include <xmog_java_lang_System.h>

List of all members.

Static Public Member Functions

static char * getProperty (const char *name, xmog_localenv *env=NULL)
 Returns the value of the given property or NULL if it does not exist.
static void setProperty (const char *name, const char *value, xmog_localenv *env=NULL)
 Sets the value of the given property.
static void gc (xmog_localenv *env=NULL)
 Asks the Java garbage collector to run.
static jlong totalMemory (xmog_localenv *env=NULL)
 Returns the total amount of memory in the JVM.
static jlong freeMemory (xmog_localenv *env=NULL)
 Returns the amount of free memory in the JVM.
static jlong maxMemory (xmog_localenv *env=NULL)
 Returns the maximal amount of memory that the JVM will attempt to use.
static jint availableProcessors (xmog_localenv *env=NULL)
 Returns the number of processors on the system.


Detailed Description

A utility class that exposes some system/runtime functions to C++.

This class is useful when we need a convenient way to check or modify system properties at runtime, for example in a configuration hook that adds system properties immediately after the JVM has been loaded.

It is also useful when you need to query the grbage collector for stats on available heap, etc.


Member Function Documentation

static jint xmog_java_lang_System::availableProcessors xmog_localenv env = NULL  )  [static]
 

Returns the number of processors on the system.

This function is only available in JREs since version 1.4. If called in an earlier JVM, the return value is undefined (but most likely 1).

Parameters:
env an optional local call environment. Defaults to NULL.

static jlong xmog_java_lang_System::freeMemory xmog_localenv env = NULL  )  [static]
 

Returns the amount of free memory in the JVM.

Parameters:
env an optional local call environment. Defaults to NULL.

static void xmog_java_lang_System::gc xmog_localenv env = NULL  )  [static]
 

Asks the Java garbage collector to run.

Parameters:
env an optional local call environment. Defaults to NULL.

static char* xmog_java_lang_System::getProperty const char *  name,
xmog_localenv env = NULL
[static]
 

Returns the value of the given property or NULL if it does not exist.

Parameters:
name the property name.
env an optional local call environment. Defaults to NULL.
Returns:
the value or NULL. The caller is responsible for freeing the returned string with a call to xmog_java_string::free() or xmog_util::free().

static jlong xmog_java_lang_System::maxMemory xmog_localenv env = NULL  )  [static]
 

Returns the maximal amount of memory that the JVM will attempt to use.

This function is only available in JREs since version 1.4.

Parameters:
env an optional local call environment. Defaults to NULL.

static void xmog_java_lang_System::setProperty const char *  name,
const char *  value,
xmog_localenv env = NULL
[static]
 

Sets the value of the given property.

Parameters:
name the property name.
value the property value.
env an optional local call environment. Defaults to NULL.

static jlong xmog_java_lang_System::totalMemory xmog_localenv env = NULL  )  [static]
 

Returns the total amount of memory in the JVM.

Parameters:
env an optional local call environment. Defaults to NULL.


The documentation for this class was generated from the following file:
Generated on Wed May 31 14:01:30 2006 for Shared Codemesh Runtime Library API Reference by  doxygen 1.4.1