tyrex.util
Class Configuration

java.lang.Object
  extended bytyrex.util.Configuration

public final class Configuration
extends java.lang.Object

Provides basic configuration for Tyrex components based on the tyrex.config configuration file. Several Tyrex services rely on this configuration file.

Version:
$Revision: 1.9 $ $Date: 2004/04/30 06:09:06 $
Author:
Assaf Arkin

Field Summary
static java.lang.String CONFIG_SYSTEM_PROPERTY
          The system property that specifies the configuration file name.
static boolean console
          Public member variable that determines whether Tyrex should emit information messages to the console.
static java.lang.String COPYRIGHT
          The copyright message.
static java.lang.String FILE_NAME
          The name of the server configuration file (tyrex.config).
static java.lang.String PROPERTY_DOMAIN_FILES
          Property that specified the name of domain configuration file(s) to load at startup.
static java.lang.String PROPERTY_LOG_CONSOLE
          Property specifying whether to enable console logging.
static java.lang.String PROPERTY_LOG_VERBOSE
          Property specifying whether to run in verbose mode.
static java.lang.String PROPERTY_SECURE_RANDOM
          Property that determines whether to use secure or standard random number generator.
static java.lang.String PROPERTY_SYNCH_EVERY
          Property that determines the number of unsynchronized cycles before the clock is synchronized.
static java.lang.String PROPERTY_UNSYNCH_TICKS
          Property that determines the number of clock ticks for each unsynchronized cycle.
static java.lang.String PROPERTY_UUID_STATE_FILE
          Property that specifies the name of the UUID state file.
static java.lang.String TITLE
          The product title.
static java.lang.String VENDOR_NAME
          The vendor name.
static java.lang.String VENDOR_URL
          The vendor URL.
static boolean verbose
          Public member variable that determines whether Tyrex should emit verbose information messages, which can be used for troubleshooting purposes.
static java.lang.String VERSION
          The version number.
 
Constructor Summary
Configuration()
           
 
Method Summary
static boolean getBoolean(java.lang.String name)
           
static int getInteger(java.lang.String name)
           
static java.util.Properties getProperties()
           
static java.lang.String getProperty(java.lang.String name)
           
static java.lang.String getProperty(java.lang.String name, java.lang.String defValue)
          Returns a property from the default configuration file.
static java.util.Random getRandom()
          Returns a random number generator.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

PROPERTY_LOG_VERBOSE

public static final java.lang.String PROPERTY_LOG_VERBOSE
Property specifying whether to run in verbose mode. tyrex.log.verbose

See Also:
Constant Field Values

PROPERTY_LOG_CONSOLE

public static final java.lang.String PROPERTY_LOG_CONSOLE
Property specifying whether to enable console logging. tyrex.log.console

See Also:
Constant Field Values

PROPERTY_UNSYNCH_TICKS

public static final java.lang.String PROPERTY_UNSYNCH_TICKS
Property that determines the number of clock ticks for each unsynchronized cycle. The value is an integer, the percision is milliseconds. The name of this property is tyrex.clock.unsynchicks.

See Also:
Constant Field Values

PROPERTY_SYNCH_EVERY

public static final java.lang.String PROPERTY_SYNCH_EVERY
Property that determines the number of unsynchronized cycles before the clock is synchronized. The value is an integer. The name of this property is tyrex.clock.synchEvery.

See Also:
Constant Field Values

PROPERTY_SECURE_RANDOM

public static final java.lang.String PROPERTY_SECURE_RANDOM
Property that determines whether to use secure or standard random number generator. This value is true or false. The name of this property is tyrex.random.secure.

See Also:
Constant Field Values

PROPERTY_UUID_STATE_FILE

public static final java.lang.String PROPERTY_UUID_STATE_FILE
Property that specifies the name of the UUID state file. The UUID state file is used to store the node identifier and clock sequence. The name of this property is tyrex.uuid.stateFile.

See Also:
Constant Field Values

PROPERTY_DOMAIN_FILES

public static final java.lang.String PROPERTY_DOMAIN_FILES
Property that specified the name of domain configuration file(s) to load at startup. This value is a comma separated list of zero or more file names. The name of this property is tyrex.domain.files.

See Also:
Constant Field Values

VENDOR_NAME

public static final java.lang.String VENDOR_NAME
The vendor name. This variable is read from the configuration file.


VENDOR_URL

public static final java.lang.String VENDOR_URL
The vendor URL. This variable is read from the configuration file.


VERSION

public static final java.lang.String VERSION
The version number. This variable is read from the configuration file.


TITLE

public static final java.lang.String TITLE
The product title. This variable is read from the configuration file.


COPYRIGHT

public static final java.lang.String COPYRIGHT
The copyright message. This variable is read from the configuration file.


FILE_NAME

public static final java.lang.String FILE_NAME
The name of the server configuration file (tyrex.config).

See Also:
Constant Field Values

CONFIG_SYSTEM_PROPERTY

public static final java.lang.String CONFIG_SYSTEM_PROPERTY
The system property that specifies the configuration file name. If this system property is specified, it will be used to load the configuration file. Otherwise, the configuration file FILE_NAME will be looked for in the classpath.

See Also:
Constant Field Values

verbose

public static final boolean verbose
Public member variable that determines whether Tyrex should emit verbose information messages, which can be used for troubleshooting purposes. This variable is set from the configuration file.


console

public static final boolean console
Public member variable that determines whether Tyrex should emit information messages to the console. This variable is set from the configuration file.

Constructor Detail

Configuration

public Configuration()
Method Detail

getProperty

public static java.lang.String getProperty(java.lang.String name,
                                           java.lang.String defValue)
Returns a property from the default configuration file.

Parameters:
name - The property name
Returns:
The property's value

getProperty

public static java.lang.String getProperty(java.lang.String name)

getProperties

public static java.util.Properties getProperties()

getBoolean

public static boolean getBoolean(java.lang.String name)

getInteger

public static int getInteger(java.lang.String name)

getRandom

public static java.util.Random getRandom()
Returns a random number generator. Depending on the configuration this is either a secure random number generator, or a standard random number generator seeded with the system clock.

Returns:
A random number generator


Original code is Copyright (c) 1999-2001, Intalio, Inc. All Rights Reserved. Contributions by MetaBoss team are Copyright (c) 2003-2005, Softaris Pty. Ltd. All Rights Reserved.