org.apache.tomcat.jni

Class OS

public class OS extends Object

OS

Version: $Revision: 467222 $, $Date: 2006-10-24 05:17:11 +0200 (Tue, 24 Oct 2006) $

Author: Mladen Turk

Field Summary
static booleanIS_BSD
static booleanIS_LINUX
static booleanIS_NETWARE
static booleanIS_SOLARIS
static booleanIS_UNIX
static booleanIS_WIN32
static booleanIS_WIN64
static intLOG_DEBUG
static intLOG_EMERG
static intLOG_ERROR
static intLOG_INFO
static intLOG_NOTICE
static intLOG_WARN
Method Summary
static StringdefaultEncoding(long pool)
Get the name of the system default characer set.
static Stringexpand(String str)
Expand environment variables.
static intinfo(long[] inf)
Gather system info.
static StringlocaleEncoding(long pool)
Get the name of the current locale character set.
static intrandom(byte[] buf, int len)
Generate random bytes.
static voidsyslog(int level, String message)
Log message.
static voidsysloginit(String domain)
Initialize system logging.

Field Detail

IS_BSD

public static final boolean IS_BSD

IS_LINUX

public static final boolean IS_LINUX

IS_NETWARE

public static final boolean IS_NETWARE

IS_SOLARIS

public static final boolean IS_SOLARIS

IS_UNIX

public static final boolean IS_UNIX

IS_WIN32

public static final boolean IS_WIN32

IS_WIN64

public static final boolean IS_WIN64

LOG_DEBUG

public static final int LOG_DEBUG

LOG_EMERG

public static final int LOG_EMERG

LOG_ERROR

public static final int LOG_ERROR

LOG_INFO

public static final int LOG_INFO

LOG_NOTICE

public static final int LOG_NOTICE

LOG_WARN

public static final int LOG_WARN

Method Detail

defaultEncoding

public static String defaultEncoding(long pool)
Get the name of the system default characer set.

Parameters: pool the pool to allocate the name from, if needed

expand

public static String expand(String str)
Expand environment variables.

Parameters: str String to expand

Returns: Expanded string with replaced environment variables.

info

public static int info(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.
 

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

localeEncoding

public static String localeEncoding(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.

Parameters: pool the pool to allocate the name from, if needed

random

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

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

syslog

public static void syslog(int level, String message)
Log message.

Parameters: level Log message severity. See LOG_XXX enums. message Message to log

sysloginit

public static void sysloginit(String domain)
Initialize system logging.

Parameters: domain String that will be prepended to every message

Copyright © 2000-2011 Apache Software Foundation. All Rights Reserved.