org.apache.beehive.netui.util.config
Class ConfigUtil

Object
  extended by ConfigUtil

public final class ConfigUtil
extends Object

Utility class for reading properties from the NetUI configuration file.

The webapp runtime is read from the InputStream passed to the init(InputStream) method. The configuration should be initialized with this method and a valid InputStream before the first time the getConfig() method is called. If the configuration has not been initialized, getConfig() will initialize a bare bones runtime configuration. Depending on the web application, this default configuration may lead to runtime errors.


Constructor Summary
ConfigUtil()
           
 
Method Summary
static NetuiConfigDocument.NetuiConfig getConfig()
           Get the NetUI configuration object.
static void init(InputStream is)
           Initialize the NetUI configuration data.
 
Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ConfigUtil

public ConfigUtil()
Method Detail

init

public static final void init(InputStream is)
                       throws ConfigInitializationException

Initialize the NetUI configuration data.

This method can be called exactly once in a J2EE web application. The InputStream parameter should reference a netui-config.xml file. If an error occurs loading the configuration file, a ConfigInitializationException will be thrown.

Parameters:
is - the InputStream from which to read the configuration file
Throws:
ConfigInitializationException - thrown when an error occurs loading the configuration file or when the configuration is reinitialized.

getConfig

public static NetuiConfigDocument.NetuiConfig getConfig()

Get the NetUI configuration object.

Returns:
a configuration bean that contains data parsed from the netui-config.xml file.