com.caucho.server.util
Class CauchoSystem

java.lang.Object
  extended by com.caucho.server.util.CauchoSystem

public class CauchoSystem
extends java.lang.Object

A wrapper for Caucho system variables, allowing tests to override the default variables.


Field Summary
static int EXIT_BIND
           
static int EXIT_DEADLOCK
           
static int EXIT_OOM
           
static int EXIT_OTHER
           
 
Method Summary
static void exitOom(java.lang.Class<?> cl, java.lang.Throwable e)
           
static java.lang.String getClassPath()
          Returns the system classpath, including the bootpath
static java.util.ArrayList<java.lang.String> getClassPathList()
          Returns the system classpath, including the bootpath
static char getFileSeparatorChar()
           
static java.lang.String getFullVersion()
           
static double getLoadAvg()
           
static java.lang.String getLocalHost()
           
static java.lang.String getNewlineString()
           
static char getPathSeparatorChar()
           
static java.lang.String getResinConfig()
           
static Path getResinHome()
          Gets the Path used as ResinHome.
static java.lang.String getServerId()
           
static java.lang.String getUserDir()
           
static java.lang.String getUserName()
           
static java.lang.String getVersion()
           
static long getVersionId()
           
static Path getWorkPath()
          Returns a path to the work directory.
static boolean is64Bit()
           
static boolean isCaseInsensitive()
           
static boolean isDetailedStatistics()
          Detailed statistics cause various parts of Resin to keep more detailed statistics at the possible expense of some performance.
static boolean isJdk15()
           
static boolean isTest()
           
static boolean isTesting()
          Returns true if we're currently running a test.
static boolean isUnix()
           
static boolean isWindows()
           
static java.lang.Class<?> loadClass(java.lang.String name)
          Loads a class from the context class loader.
static java.lang.Class<?> loadClass(java.lang.String name, boolean init, java.lang.ClassLoader loader)
          Loads a class from a classloader.
static void setDetailedStatistics(boolean isVerboseStatistics)
          Set true to cause the tracking of detailed statistcs, default false.
static void setIsTesting(boolean testing)
           
static void setResinHome(Path path)
          Sets the Path to be used as ResinHome.
static void setWindowsTest(boolean isWindows)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

EXIT_BIND

public static int EXIT_BIND

EXIT_OOM

public static int EXIT_OOM

EXIT_DEADLOCK

public static int EXIT_DEADLOCK

EXIT_OTHER

public static int EXIT_OTHER
Method Detail

isTesting

public static boolean isTesting()
Returns true if we're currently running a test.


setIsTesting

public static void setIsTesting(boolean testing)

setResinHome

public static void setResinHome(Path path)
Sets the Path to be used as ResinHome.


getResinHome

public static Path getResinHome()
Gets the Path used as ResinHome.


getVersion

public static java.lang.String getVersion()

getFullVersion

public static java.lang.String getFullVersion()

getVersionId

public static long getVersionId()

getResinConfig

public static java.lang.String getResinConfig()

getWorkPath

public static Path getWorkPath()
Returns a path to the work directory. The work directory is specified in the resin.conf by /caucho.com/java/work-path. If unspecified, it defaults to /tmp/caucho.

Returns:
directory path to work in.

getServerId

public static java.lang.String getServerId()

getUserDir

public static java.lang.String getUserDir()

getFileSeparatorChar

public static char getFileSeparatorChar()

getPathSeparatorChar

public static char getPathSeparatorChar()

getNewlineString

public static java.lang.String getNewlineString()

isWindows

public static boolean isWindows()

isTest

public static boolean isTest()

isCaseInsensitive

public static boolean isCaseInsensitive()

isUnix

public static boolean isUnix()

setWindowsTest

public static void setWindowsTest(boolean isWindows)

getLocalHost

public static java.lang.String getLocalHost()

isJdk15

public static boolean isJdk15()

getUserName

public static java.lang.String getUserName()

setDetailedStatistics

public static void setDetailedStatistics(boolean isVerboseStatistics)
Set true to cause the tracking of detailed statistcs, default false. Detailed statistics cause various parts of Resin to keep more detailed statistics at the possible expense of performance.


isDetailedStatistics

public static boolean isDetailedStatistics()
Detailed statistics cause various parts of Resin to keep more detailed statistics at the possible expense of some performance.


loadClass

public static java.lang.Class<?> loadClass(java.lang.String name)
                                    throws java.lang.ClassNotFoundException
Loads a class from the context class loader.

Parameters:
name - the classname, separated by '.'
Returns:
the loaded class.
Throws:
java.lang.ClassNotFoundException

loadClass

public static java.lang.Class<?> loadClass(java.lang.String name,
                                           boolean init,
                                           java.lang.ClassLoader loader)
                                    throws java.lang.ClassNotFoundException
Loads a class from a classloader. If the loader is null, uses the context class loader.

Parameters:
name - the classname, separated by '.'
init - if true, resolves the class instances
loader - the class loader
Returns:
the loaded class.
Throws:
java.lang.ClassNotFoundException

getClassPath

public static java.lang.String getClassPath()
Returns the system classpath, including the bootpath


getClassPathList

public static java.util.ArrayList<java.lang.String> getClassPathList()
Returns the system classpath, including the bootpath


getLoadAvg

public static double getLoadAvg()

exitOom

public static void exitOom(java.lang.Class<?> cl,
                           java.lang.Throwable e)

is64Bit

public static boolean is64Bit()
Returns: