org.nakedobjects
Class Application

java.lang.Object
  extended byorg.nakedobjects.Application
Direct Known Subclasses:
Client, Exploration, ObjectServer

public abstract class Application
extends java.lang.Object


Constructor Summary
Application()
           
 
Method Summary
protected  void configureSystemLogging()
          Configures Apache LOG4J to default logging.
protected static boolean hasProperty(java.lang.String key)
          Indicates whether the named configuration property exists.
protected static void loadConfiguration(java.lang.String configFile, java.lang.String defaultConfigFile)
          Loads up the specified configuration file.
protected static void set(java.lang.String key, java.lang.String value)
          Allows a configuration property to be programmatically set, or overriden.
protected static java.lang.String setting(java.lang.String key)
          Retrieves the named property value.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Application

public Application()
Method Detail

configureSystemLogging

protected void configureSystemLogging()
                               throws ConfigurationException
Configures Apache LOG4J to default logging.

Throws:
ConfigurationException

hasProperty

protected static boolean hasProperty(java.lang.String key)
Indicates whether the named configuration property exists.


set

protected static void set(java.lang.String key,
                          java.lang.String value)
Allows a configuration property to be programmatically set, or overriden. This can be used to ensure a property is set in code, rather than relying on it being provided within the configuration file. If this method is called with a property having the same name as one in the configuration file then that user defined value will be replaced.

Parameters:
key - name of the property
value - the value of the property

setting

protected static java.lang.String setting(java.lang.String key)
                                   throws ConfigurationException
Retrieves the named property value.

Throws:
ConfigurationException - when the specfied property does not exist.

loadConfiguration

protected static void loadConfiguration(java.lang.String configFile,
                                        java.lang.String defaultConfigFile)
                                 throws ConfigurationException
Loads up the specified configuration file. If none is specified, then the default configuration file is loaded. If no file can be found a ConfigurationException is thrown and the system should exit.

Throws:
ConfigurationException