FileDocCategorySizeDatePackage
OS.javaAPI DocApache Tomcat 6.0.144550Fri Jul 20 04:20:34 BST 2007org.apache.tomcat.jni

OS

public class OS extends Object
OS
author
Mladen Turk
version
$Revision: 467222 $, $Date: 2006-10-24 05:17:11 +0200 (mar., 24 oct. 2006) $

Fields Summary
private static final int
UNIX
private static final int
NETWARE
private static final int
WIN32
private static final int
WIN64
private static final int
LINUX
private static final int
SOLARIS
private static final int
BSD
public static final int
LOG_EMERG
public static final int
LOG_ERROR
public static final int
LOG_NOTICE
public static final int
LOG_WARN
public static final int
LOG_INFO
public static final int
LOG_DEBUG
public static final boolean
IS_UNIX
public static final boolean
IS_NETWARE
public static final boolean
IS_WIN32
public static final boolean
IS_WIN64
public static final boolean
IS_LINUX
public static final boolean
IS_SOLARIS
public static final boolean
IS_BSD
Constructors Summary
Methods Summary
public static native java.lang.StringdefaultEncoding(long pool)
Get the name of the system default characer set.

param
pool the pool to allocate the name from, if needed

public static native java.lang.Stringexpand(java.lang.String str)
Expand environment variables.

param
str String to expand
return
Expanded string with replaced environment variables.

public static native intinfo(long[] inf)
Gather system info.
On exit the inf array will be filled with:
inf[0] - Total usable main memory size
inf[1] - Available memory size
inf[2] - Total page file/swap space size
inf[3] - Page file/swap space still available
inf[4] - Amount of shared memory
inf[5] - Memory used by buffers
inf[6] - Memory Load

inf[7] - Idle Time in microseconds
inf[8] - Kernel Time in microseconds
inf[9] - User Time in microseconds

inf[10] - Process creation time (apr_time_t)
inf[11] - Process Kernel Time in microseconds
inf[12] - Process User Time in microseconds

inf[13] - Current working set size.
inf[14] - Peak working set size.
inf[15] - Number of page faults.

param
inf array that will be filled with system information. Array length must be at least 16.

private static native booleanis(int type)
Check for OS type.

param
type OS type to test.

public static native java.lang.StringlocaleEncoding(long pool)
Get the name of the current locale character set. Defers to apr_os_default_encoding if the current locale's data can't be retreved on this system.

param
pool the pool to allocate the name from, if needed

public static native intrandom(byte[] buf, int len)
Generate random bytes.

param
buf Buffer to fill with random bytes
param
len Length of buffer in bytes

public static native voidsyslog(int level, java.lang.String message)
Log message.

param
level Log message severity. See LOG_XXX enums.
param
message Message to log

public static native voidsysloginit(java.lang.String domain)
Initialize system logging.

param
domain String that will be prepended to every message