|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.jstatcom.engine.ConfigHolder
public final class ConfigHolder
This class is used by Engine
instances to get all information
that is necessary to run a specific engine. The types of configuration
settings are defined in the ConfigKeys
implementation for the
underlying engine type. Instances of this class store information according
to the respective configuration keys.
For every engine type there exists only one instance of this class. Instances
for engine types are created or referenced by the static factory method
valueOf
.
All information is stored permanently in an XML file defined in the respective engine type.
EngineTypes
,
ConfigKeys
Nested Class Summary | |
---|---|
static class |
ConfigHolder.KeyValPair
Inner class for storing key value pairs of this collection as XML elements. |
Field Summary | |
---|---|
static javolution.xml.XmlFormat<ConfigHolder> |
ConfigHolder_XML
XML format field for (de)serialization. |
Method Summary | |
---|---|
void |
adjustConfig()
Creates a dialog to change the configuration settings for the respective engine. |
java.lang.String |
getConfig(ConfigKeys key)
Get a configuration value for a key. |
java.util.Set<ConfigKeys> |
getConfigKeys()
Gets a Set of all available ConfigKeys . |
EngineTypes |
getEngineType()
Returns the engine type associated with this . |
void |
setConfig(ConfigKeys configKey,
java.lang.String value)
Set a key value pair to be stored by the config holder. |
static ConfigHolder |
valueOf(EngineTypes engineType)
Static initializer to return an instance of ConfigHolder . |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final javolution.xml.XmlFormat<ConfigHolder> ConfigHolder_XML
Method Detail |
---|
public void adjustConfig()
public java.lang.String getConfig(ConfigKeys key)
key
- that defines type of setting
key
or null
if the key is not contained
java.lang.IllegalArgumentException
- if (key == null)
public java.util.Set<ConfigKeys> getConfigKeys()
Set
of all available ConfigKeys
.
public final EngineTypes getEngineType()
this
.
public void setConfig(ConfigKeys configKey, java.lang.String value)
configKey
- the keyvalue
- the value
java.lang.IllegalArgumentException
- if (configKey == null)
or if
configKey
is not valid for the underlying
engine typepublic static ConfigHolder valueOf(EngineTypes engineType)
ConfigHolder
.
It parses the XML config file if it exists and tries to get all necessary
configuration information. If the config file does not exist or if
something is wrong with the settings, an input dialog is shown. The
configuration file is updated if something has changed.
engineType
- to define a specific engine
java.lang.IllegalArgumentException
- if (engineType == null)
java.lang.IllegalStateException
- if the user input dialog is cancelled but the settings are
still invalid
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |