Rice Pastry API

rice.environment
Class Environment

java.lang.Object
  extended byrice.environment.Environment

public class Environment
extends java.lang.Object

Used to provide properties, timesource, loggers etc to the FreePastry apps and components. XXX: Plan is to place the environment inside a PastryNode.

Version:
$Id: pretty.settings,v 1.3 2005/03/11 20:22:33 jeffh Exp $
Author:
Jeff Hoye

Field Summary
static java.lang.String[] defaultParamFileArray
          DESCRIBE THE FIELD
 LogManager logging
          DESCRIBE THE FIELD
 Parameters params
          DESCRIBE THE FIELD
 RandomSource randomSource
          DESCRIBE THE FIELD
 SelectorManager selectorManager
          DESCRIBE THE FIELD
 TimeSource time
          DESCRIBE THE FIELD
 
Constructor Summary
Environment()
          Convienience for defaults.
Environment(SelectorManager sm, RandomSource rs, TimeSource time, LogManager lm, Parameters params)
          Constructor.
Environment(java.lang.String paramFileName)
          Constructor for Environment.
Environment(java.lang.String[] orderedDefaultFiles, java.lang.String paramFileName)
          Convienience for defaults.
 
Method Summary
protected  void chooseDefaults()
          Can be easily overridden by a subclass.
 LogManager getLogManager()
          Gets the LogManager attribute of the Environment object
 Parameters getParameters()
          Gets the Parameters attribute of the Environment object
 RandomSource getRandomSource()
          Gets the RandomSource attribute of the Environment object
 SelectorManager getSelectorManager()
          Gets the SelectorManager attribute of the Environment object
 TimeSource getTimeSource()
          Gets the TimeSource attribute of the Environment object
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

selectorManager

public SelectorManager selectorManager
DESCRIBE THE FIELD


randomSource

public RandomSource randomSource
DESCRIBE THE FIELD


time

public TimeSource time
DESCRIBE THE FIELD


logging

public LogManager logging
DESCRIBE THE FIELD


params

public Parameters params
DESCRIBE THE FIELD


defaultParamFileArray

public static final java.lang.String[] defaultParamFileArray
DESCRIBE THE FIELD

Constructor Detail

Environment

public Environment(SelectorManager sm,
                   RandomSource rs,
                   TimeSource time,
                   LogManager lm,
                   Parameters params)
Constructor. You can provide null values for all/any paramenters, which will result in a default choice. If you want different defaults, consider extending Environment and providing your own chooseDefaults() method.

Parameters:
sm - the SelectorManager. Default: rice.selector.SelectorManager
rs - the RandomSource. Default: rice.environment.random.simple.SimpleRandomSource
time - the TimeSource. Default: rice.environment.time.simple.SimpleTimeSource
lm - the LogManager. Default: rice.environment.logging.simple.SimpleLogManager
params - DESCRIBE THE PARAMETER

Environment

public Environment(java.lang.String[] orderedDefaultFiles,
                   java.lang.String paramFileName)
Convienience for defaults.

Parameters:
paramFileName - the file where parameters are saved
orderedDefaultFiles - DESCRIBE THE PARAMETER
Throws:
java.io.IOException

Environment

public Environment(java.lang.String paramFileName)
Constructor for Environment.

Parameters:
paramFileName - DESCRIBE THE PARAMETER

Environment

public Environment()
Convienience for defaults. Has no parameter file to load/store.

Method Detail

getSelectorManager

public SelectorManager getSelectorManager()
Gets the SelectorManager attribute of the Environment object

Returns:
The SelectorManager value

getRandomSource

public RandomSource getRandomSource()
Gets the RandomSource attribute of the Environment object

Returns:
The RandomSource value

getTimeSource

public TimeSource getTimeSource()
Gets the TimeSource attribute of the Environment object

Returns:
The TimeSource value

getLogManager

public LogManager getLogManager()
Gets the LogManager attribute of the Environment object

Returns:
The LogManager value

getParameters

public Parameters getParameters()
Gets the Parameters attribute of the Environment object

Returns:
The Parameters value

chooseDefaults

protected void chooseDefaults()
Can be easily overridden by a subclass.


Rice Pastry API

Copyright © 2001-2005 - Rice Pastry.