ZetaGrid v1.9

zeta
Class ZetaProperties

java.lang.Object
  |
  +--zeta.ZetaProperties

public class ZetaProperties
extends java.lang.Object

The ZetaProperties class represents a persistent set of properties. The Properties are loaded from the file "zeta.cfg." Each key and its corresponding value in the property list is a string. If the property key is not found in the original property list then the second property list "default.cfg" is searched. The default property file has the following content:

# host identification via HTTP
host.name=www.zetagrid.net
host.port=80
downloadURL=/servlet/service/getClient
requestURL=/servlet/service/requestWorkUnit
resultURL=/servlet/service/result

# executes the specified method
exec.class=zeta.ZetaCalc
exec.method=run

# size of the packages (Pentium III 800 MHz):
# t: tiny package ~ 60 minutes
# s: small package ~ 90 minutes
# m: medium package ~ 3 hours
# l: large package ~ 4 hours
# h: huge package ~ 6 hours
package_size=m

# max. number of packages is 5
packages=1

# number of packages must be greater or equal than the number of processors
# please contact Sebastian Wedeniwski (wedeniws@de.ibm.com) if you want to use more than 5 processors
# the value 0 sequentially completes all local packages and terminates the process
processors=1

# usage of the processor power
# the value 0 means the usage of the complete CPU power
# a small value (>0) reduce the intensity, e.g. 5000
sleepN=0

# set the task which should be computed
# the default is 'zeta-zeros': Computation of the zeros of the Riemann zeta function
task=zeta-zeros

# port number which is used to avoid conflicts
# this port number must be changed if it is used by other applications, e.g. www.webmin.com
port=10000

# the folowing two parameters are used by the screen saver
prio=low
call=java.exe -Xmx128m -cp zeta.jar;zeta_client.jar zeta.ZetaClient


Field Summary
private  java.util.Properties props
          The main property list.
private  java.util.Properties propsDefault
          A property list that contains default values for any keys not found in the main property list.
 
Constructor Summary
ZetaProperties()
          Creates a property list with the keys of the property files "zeta.cfg" and "default.cfg."
 
Method Summary
 java.lang.String get(java.lang.String key)
          Searches for the property with the specified key in this property list.
 int get(java.lang.String key, int defaultValue)
          Searches for the property with the specified key in this property list.
 java.lang.String get(java.lang.String key, java.lang.String defaultValue)
          Searches for the property with the specified key in this property list.
 void load()
          Loads the property files "zeta.cfg" and "default.cfg."
 void reload()
          Reloads the property files "zeta.cfg" and "default.cfg."
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

propsDefault

private java.util.Properties propsDefault
A property list that contains default values for any keys not found in the main property list.


props

private java.util.Properties props
The main property list.

Constructor Detail

ZetaProperties

public ZetaProperties()
Creates a property list with the keys of the property files "zeta.cfg" and "default.cfg."

Method Detail

reload

public void reload()
Reloads the property files "zeta.cfg" and "default.cfg."


load

public void load()
Loads the property files "zeta.cfg" and "default.cfg."


get

public java.lang.String get(java.lang.String key)
Searches for the property with the specified key in this property list. If the key is not found in this property list, the default property list, and its defaults, recursively, are then checked. The method returns null if the property is not found.

Parameters:
key - the property key.

get

public java.lang.String get(java.lang.String key,
                            java.lang.String defaultValue)
Searches for the property with the specified key in this property list. If the key is not found in this property list, the default property list, and its defaults, recursively, are then checked. The method returns the default value argument if the property is not found.

Parameters:
key - the property key.
defaultValue - a default value.
Returns:
the value in this property list with the specified key value.

get

public int get(java.lang.String key,
               int defaultValue)
Searches for the property with the specified key in this property list. If the key is not found in this property list, the default property list, and its defaults, recursively, are then checked. The method returns the default value argument if the property is not found or not an integer.

Parameters:
key - the property key.
defaultValue - a default value.
Returns:
the value in this property list with the specified key value.

ZetaGrid v1.9

For further technical papers, see ZetaGrid Technical Documentation.
 
Copyright © 2001,2002 Sebastian Wedeniwski. All Rights Reserved.