|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectedu.cmu.sphinx.util.props.ConfigurationManager
Manages the configuration for the system. The configuration manager provides the following services:
For an overview of how to use this configuration management system to create and configure components please see: Sphinx-4 Configuration Management
For a description of how to create your own configurable components see:
Configurable
Field Summary | |
static java.lang.String |
PROP_COMMON_LOG_LEVEL
A common property (used by all components) that sets the log level for the component. |
static java.lang.String |
PROP_COMMON_LOG_TERSE
A common property (used by all components) that sets the tersness of the log output |
static java.lang.String |
PROP_SHOW_CREATIONS
Sphinx Property that defines whether or not the configuration manager will trace object creations |
static boolean |
PROP_SHOW_CREATIONS_DEFAULT
The default value for PROP_SHOW_CREATIONS |
Constructor Summary | |
ConfigurationManager(java.net.URL url)
Creates a new configuration manager. |
Method Summary | |
void |
editConfig(java.lang.String name)
|
java.lang.String[] |
getInstanceNames(java.lang.Class type)
Gets all instances that are of the given type or are assignable to that type. |
PropertySheet |
getPropertySheet(java.lang.String instanceName)
Returns the property sheet for the given object instance |
Registry |
getRegistry(java.lang.String instanceName)
Returns the registry for the given object instance |
Configurable |
lookup(java.lang.String name)
Looks up a configurable component by name. |
void |
save(java.io.File file)
Saves the current configuration to the given file |
void |
setProperty(java.lang.String component,
java.lang.String prop,
java.lang.String value)
Sets the property of the given component to the given value. |
void |
showConfig()
Shows the current configuration |
void |
showConfig(java.lang.String name)
Show the configuration for the compnent with the given name |
void |
showConfigAsGDL(java.lang.String path)
Dumps the config as a GDL plot |
void |
showConfigAsHTML(java.lang.String path)
Dumps the config as a set of HTML tables |
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final java.lang.String PROP_SHOW_CREATIONS
public static final boolean PROP_SHOW_CREATIONS_DEFAULT
public static final java.lang.String PROP_COMMON_LOG_LEVEL
Level
,
Constant Field Valuespublic static final java.lang.String PROP_COMMON_LOG_TERSE
Constructor Detail |
public ConfigurationManager(java.net.URL url) throws java.io.IOException, PropertyException
url
- place to load initial properties from
java.io.IOException
- if an error occurs while loading properties from the URL
PropertyException
Method Detail |
public PropertySheet getPropertySheet(java.lang.String instanceName)
instanceName
- the instance name of the object
public Registry getRegistry(java.lang.String instanceName)
instanceName
- the instance name of the object
public java.lang.String[] getInstanceNames(java.lang.Class type)
type
- the desired type of instance
public Configurable lookup(java.lang.String name) throws java.lang.InstantiationException, PropertyException
name
- the name of the component
java.lang.InstantiationException
- if the requested object could not be properly created,
or is not a configurable object.
PropertyException
- if an error occurs while setting a propertypublic void setProperty(java.lang.String component, java.lang.String prop, java.lang.String value) throws PropertyException
component
- an existing componentprop
- the property namevalue
- the new value.
PropertyException
public void save(java.io.File file) throws java.io.IOException
file
- place to save the configuration
java.io.IOException
- if an error occurs while writing to the filepublic void showConfig()
public void showConfig(java.lang.String name)
name
- the component namepublic void editConfig(java.lang.String name)
public void showConfigAsHTML(java.lang.String path) throws java.io.IOException
path
- where to output the HTML
java.io.IOException
- if an error occurspublic void showConfigAsGDL(java.lang.String path) throws java.io.IOException
path
- where to output the GDL
java.io.IOException
- if an error occurs
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |