| java.lang.Object seda.sandStorm.main.SandstormConfig
SandstormConfig | public class SandstormConfig implements Cloneable(Code) | | This class is used to pass configuration parameters into Sandstorm
at startup time. It reads initial configuration parameters from a
file, using an XML-like format. Various operations can be performed
upon this class to modify the configuration of the Sandstorm runtime.
author: Matt Welsh See Also: Sandstorm See Also: Main |
Inner Class :class configSection | |
Inner Class :class directiveReader extends Reader | |
Constructor Summary | |
public | SandstormConfig() Create a new SandstormConfig with the default settings. | public | SandstormConfig(String defaultArgs) Create a new SandstormConfig with the default settings, with
the given default init args, which will be passed to every stage.
Each element of defaultArgs[] is a String in the format
"key=value". | public | SandstormConfig(String fname) Create a new SandstormConfig, reading the configration from the
given file. | public | SandstormConfig(String fname, String defaultArgs) Create a new SandstormConfig, reading the configration from the
given file. |
Method Summary | |
public void | addStage(String stageName, String className, String initargs) Add a stage to this SandstormConfig. | public boolean | getBoolean(String key) Return the configuration option associated with the given key
as a boolean. | public boolean | getBoolean(String key, boolean defaultval) Return the configuration option associated with the given key
as a boolean. | public SandstormConfig | getCopy() Return a copy of this object. | public double | getDouble(String key) Return the configuration option associated with the given key
as a double. | public double | getDouble(String key, double defaultval) Return the configuration option associated with the given key
as a double. | public int | getInt(String key) Return the configuration option associated with the given key
as an int. | public int | getInt(String key, int defaultval) Return the configuration option associated with the given key
as an int. | public Enumeration | getKeys(String prefix) Return an enumeration of the keys matching the given prefix. | public Enumeration | getKeys() Return an enumeration of the top-level keys in this configuration. | public Enumeration | getStages() Return an Enumeration of the stages specified by this SandstormConfig. | public String | getString(String key) Return the configuration option associated with the given key
as a String. | public String | getString(String key, String defaultval) Return the configuration option associated with the given key
as a String. | public String[] | getStringList(String key) Get the string list value corresponding to the given key. | public void | putBoolean(String key, boolean val) Set the given configuration option specified as a boolean. | public void | putDouble(String key, double val) Set the given configuration option specified as an int. | public void | putInt(String key, int val) Set the given configuration option specified as an int. | public void | putString(String key, String val) Set the given configuration option specified as a String. | public void | puttStringList(String key, String valarr) Set the given key to the given string list value. | public void | readFile(String fname) Read the configuration from the given file. |
CONFIG_FALSE | final public static String CONFIG_FALSE(Code) | | String value for setting boolean configuration entries to false.
|
CONFIG_TRUE | final public static String CONFIG_TRUE(Code) | | String value for setting boolean configuration entries to true.
|
LIST_ELEMENT_DELIMITER | final public static String LIST_ELEMENT_DELIMITER(Code) | | |
THREADMGR_AggTPSTM | final public static String THREADMGR_AggTPSTM(Code) | | Value for defaultThreadMgr to use the aggregating TPSTM.
|
THREADMGR_TPPTM | final public static String THREADMGR_TPPTM(Code) | | Value for defaultThreadMgr to use the thread-per-CPU thread manager.
|
THREADMGR_TPSTM | final public static String THREADMGR_TPSTM(Code) | | Value for defaultThreadMgr to use the thread-per-stage thread manager.
|
defaultInitArgs | public Hashtable defaultInitArgs(Code) | | Default initialization arguments passed to every stage.
|
defaults | final public static String[] defaults(Code) | | The set of default values for the Sandstorm configuration.
In order to modify the default configuration used by Sandstorm,
edit SandstormConfig.java and recompile.
|
SandstormConfig | public SandstormConfig()(Code) | | Create a new SandstormConfig with the default settings.
|
SandstormConfig | public SandstormConfig(String defaultArgs) throws IOException(Code) | | Create a new SandstormConfig with the default settings, with
the given default init args, which will be passed to every stage.
Each element of defaultArgs[] is a String in the format
"key=value". If "key" contains a dot ("."), then it will be
treated as a key to be added to the Sandstorm configuration's
global parameters. Otherwise, the key-value pair will be added to
the "initargs" section for each stage.
|
SandstormConfig | public SandstormConfig(String fname) throws IOException(Code) | | Create a new SandstormConfig, reading the configration from the
given file. The configuration file uses an XML-like structure;
see the Sandstorm documentation for more information on its format.
|
SandstormConfig | public SandstormConfig(String fname, String defaultArgs) throws IOException(Code) | | Create a new SandstormConfig, reading the configration from the
given file. The configuration file uses an XML-like structure;
see the Sandstorm documentation for more information on its format.
Parameters: defaultInitArgs - Default initialization arguments passed toevery stage. These override any arguments found in the config file.Each element of this array must be a string with the format"key=value". |
addStage | public void addStage(String stageName, String className, String initargs) throws StageNameAlreadyBoundException, IOException(Code) | | Add a stage to this SandstormConfig.
Parameters: stageName - The name of the stage as it should be registered. Parameters: className - The fully-qualified class name of the stage eventhandler. Parameters: initargs - The initial arguments to pass into the stage. |
getBoolean | public boolean getBoolean(String key)(Code) | | Return the configuration option associated with the given key
as a boolean. Returns false if not set.
|
getBoolean | public boolean getBoolean(String key, boolean defaultval)(Code) | | Return the configuration option associated with the given key
as a boolean. Returns default if not set.
|
getDouble | public double getDouble(String key)(Code) | | Return the configuration option associated with the given key
as a double. Returns -1 if not set or if the value of the key cannot
be expressed as a double.
|
getDouble | public double getDouble(String key, double defaultval)(Code) | | Return the configuration option associated with the given key
as a double. Returns default if not set or if the value of the
key cannot be expressed as a double.
|
getInt | public int getInt(String key)(Code) | | Return the configuration option associated with the given key
as an int. Returns -1 if not set or if the value of the key cannot
be expressed as an int.
|
getInt | public int getInt(String key, int defaultval)(Code) | | Return the configuration option associated with the given key
as an int. Returns default if not set or if the value of the
key cannot be expressed as an int.
|
getKeys | public Enumeration getKeys(String prefix)(Code) | | Return an enumeration of the keys matching the given prefix.
A given key maps onto a set of child keys if it ends in a
"." character (that is, it is an internal node within the tree).
A key not ending in "." is a terminal node and maps onto a
value that may be obtained using getString, getInt, or getDouble.
|
getKeys | public Enumeration getKeys()(Code) | | Return an enumeration of the top-level keys in this configuration.
|
getStages | public Enumeration getStages()(Code) | | Return an Enumeration of the stages specified by this SandstormConfig.
|
getString | public String getString(String key)(Code) | | Return the configuration option associated with the given key
as a String. Returns null if not set.
|
getString | public String getString(String key, String defaultval)(Code) | | Return the configuration option associated with the given key
as a String. Returns default if not set.
|
getStringList | public String[] getStringList(String key)(Code) | | Get the string list value corresponding to the given key.
Returns null if not set.
|
putBoolean | public void putBoolean(String key, boolean val)(Code) | | Set the given configuration option specified as a boolean.
|
putDouble | public void putDouble(String key, double val)(Code) | | Set the given configuration option specified as an int.
|
putInt | public void putInt(String key, int val)(Code) | | Set the given configuration option specified as an int.
|
putString | public void putString(String key, String val)(Code) | | Set the given configuration option specified as a String.
|
puttStringList | public void puttStringList(String key, String valarr)(Code) | | Set the given key to the given string list value.
|
|
|