|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectseda.sandStorm.main.SandstormConfig
public class SandstormConfig
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.
Sandstorm
,
Main
Nested Class Summary | |
---|---|
(package private) class |
SandstormConfig.configSection
|
(package private) class |
SandstormConfig.directiveReader
Internal class to preprocess special directives in the config file. |
Field Summary | |
---|---|
static java.lang.String |
CONFIG_FALSE
String value for setting boolean configuration entries to false. |
static java.lang.String |
CONFIG_TRUE
String value for setting boolean configuration entries to true. |
java.util.Hashtable |
defaultInitArgs
Default initialization arguments passed to every stage. |
static java.lang.String[] |
defaults
The set of default values for the Sandstorm configuration. |
static java.lang.String |
LIST_ELEMENT_DELIMITER
|
static java.lang.String |
THREADMGR_AggTPSTM
Value for defaultThreadMgr to use the aggregating TPSTM. |
static java.lang.String |
THREADMGR_TPPTM
Value for defaultThreadMgr to use the thread-per-CPU thread manager. |
static java.lang.String |
THREADMGR_TPSTM
Value for defaultThreadMgr to use the thread-per-stage thread manager. |
Constructor Summary | |
---|---|
SandstormConfig()
Create a new SandstormConfig with the default settings. |
|
SandstormConfig(java.lang.String fname)
Create a new SandstormConfig, reading the configration from the given file. |
|
SandstormConfig(java.lang.String[] defaultArgs)
Create a new SandstormConfig with the default settings, with the given default init args, which will be passed to every stage. |
|
SandstormConfig(java.lang.String fname,
java.lang.String[] defaultArgs)
Create a new SandstormConfig, reading the configration from the given file. |
Method Summary | |
---|---|
void |
addStage(java.lang.String stageName,
java.lang.String className,
java.lang.String[] initargs)
Add a stage to this SandstormConfig. |
boolean |
getBoolean(java.lang.String key)
Return the configuration option associated with the given key as a boolean. |
boolean |
getBoolean(java.lang.String key,
boolean defaultval)
Return the configuration option associated with the given key as a boolean. |
SandstormConfig |
getCopy()
Return a copy of this object. |
double |
getDouble(java.lang.String key)
Return the configuration option associated with the given key as a double. |
double |
getDouble(java.lang.String key,
double defaultval)
Return the configuration option associated with the given key as a double. |
int |
getInt(java.lang.String key)
Return the configuration option associated with the given key as an int. |
int |
getInt(java.lang.String key,
int defaultval)
Return the configuration option associated with the given key as an int. |
java.util.Enumeration |
getKeys()
Return an enumeration of the top-level keys in this configuration. |
java.util.Enumeration |
getKeys(java.lang.String prefix)
Return an enumeration of the keys matching the given prefix. |
java.util.Enumeration |
getStages()
Return an Enumeration of the stages specified by this SandstormConfig. |
java.lang.String |
getString(java.lang.String key)
Return the configuration option associated with the given key as a String. |
java.lang.String |
getString(java.lang.String key,
java.lang.String defaultval)
Return the configuration option associated with the given key as a String. |
java.lang.String[] |
getStringList(java.lang.String key)
Get the string list value corresponding to the given key. |
void |
putBoolean(java.lang.String key,
boolean val)
Set the given configuration option specified as a boolean. |
void |
putDouble(java.lang.String key,
double val)
Set the given configuration option specified as an int. |
void |
putInt(java.lang.String key,
int val)
Set the given configuration option specified as an int. |
void |
putString(java.lang.String key,
java.lang.String val)
Set the given configuration option specified as a String. |
void |
puttStringList(java.lang.String key,
java.lang.String[] valarr)
Set the given key to the given string list value. |
void |
readFile(java.lang.String fname)
Read the configuration from the given file. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final java.lang.String LIST_ELEMENT_DELIMITER
public static final java.lang.String THREADMGR_TPPTM
public static final java.lang.String THREADMGR_TPSTM
public static final java.lang.String THREADMGR_AggTPSTM
public static final java.lang.String CONFIG_TRUE
public static final java.lang.String CONFIG_FALSE
public static final java.lang.String[] defaults
public java.util.Hashtable defaultInitArgs
Constructor Detail |
---|
public SandstormConfig()
public SandstormConfig(java.lang.String[] defaultArgs) throws java.io.IOException
java.io.IOException
public SandstormConfig(java.lang.String fname) throws java.io.IOException
java.io.IOException
public SandstormConfig(java.lang.String fname, java.lang.String[] defaultArgs) throws java.io.IOException
defaultInitArgs
- Default initialization arguments passed to
every stage. These override any arguments found in the config file.
Each element of this array must be a string with the format
"key=value".
java.io.IOException
Method Detail |
---|
public java.lang.String getString(java.lang.String key)
public java.lang.String getString(java.lang.String key, java.lang.String defaultval)
public void putString(java.lang.String key, java.lang.String val)
public boolean getBoolean(java.lang.String key)
public boolean getBoolean(java.lang.String key, boolean defaultval)
public void putBoolean(java.lang.String key, boolean val)
public int getInt(java.lang.String key)
public int getInt(java.lang.String key, int defaultval)
public void putInt(java.lang.String key, int val)
public double getDouble(java.lang.String key)
public double getDouble(java.lang.String key, double defaultval)
public java.lang.String[] getStringList(java.lang.String key)
public void putDouble(java.lang.String key, double val)
public void puttStringList(java.lang.String key, java.lang.String[] valarr)
public java.util.Enumeration getKeys(java.lang.String prefix)
public java.util.Enumeration getKeys()
public SandstormConfig getCopy()
public void addStage(java.lang.String stageName, java.lang.String className, java.lang.String[] initargs) throws StageNameAlreadyBoundException, java.io.IOException
stageName
- The name of the stage as it should be registered.className
- The fully-qualified class name of the stage event
handler.initargs
- The initial arguments to pass into the stage.
StageNameAlreadyBoundException
java.io.IOException
public java.util.Enumeration getStages()
public void readFile(java.lang.String fname) throws java.io.IOException
java.io.IOException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |