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

Object
  extended by ConfigUtil

public class ConfigUtil
extends Object

Utility class for reading properties from the NetUI configuration file.

The webapp runtime is read from the XmlInputStreamResolver passed to the init(XmlInputStreamResolver) method. The configuration should be initialized with this method before the first call to the getConfig() method. If the configuration has not been initialized, getConfig() will initialize a default, minimal runtime configuration. Depending on the web application, this default configuration may lead to runtime errors.


Constructor Summary
protected ConfigUtil()
           
 
Method Summary
static NetUIConfig getConfig()
          Get the NetUI configuration JavaBean.
static void init(XmlInputStreamResolver xmlInputStreamResolver)
           Initialize the NetUI configuration JavaBean.
protected static void internalInit(XmlInputStreamResolver xmlInputStreamResolver)
           
static boolean isInit()
           
 
Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ConfigUtil

protected ConfigUtil()
Method Detail

init

public static void init(XmlInputStreamResolver xmlInputStreamResolver)
                 throws ConfigInitializationException

Initialize the NetUI configuration JavaBean.

This method can be called exactly once in the a given J2EE web application. The provided XmlInputStreamResolver is used to resolve an InputStream that references a NetUI config file instance. If an error occurs loading the configuration, a ConfigInitializationException exception will be thrown.

Parameters:
xmlInputStreamResolver - a resolver that can provide an InputStream to the config file
Throws:
ConfigInitializationException - thrown when an error occurs loading the configuration file or when the configuration is reinitialized.

internalInit

protected static void internalInit(XmlInputStreamResolver xmlInputStreamResolver)

isInit

public static boolean isInit()

getConfig

public static NetUIConfig getConfig()
Get the NetUI configuration JavaBean.

Returns:
a JavaBean that provides configuration information for the NetUI runtime.