ERXConfigurationManager Class Reference

Collaboration diagram for ERXConfigurationManager:

Collaboration graph
[legend]

List of all members.

Public Member Functions

Properties applyConfiguration (Properties systemProperties)
Properties commandLineArgumentProperties ()
String[] commandLineArguments ()
void configureRapidTurnAround ()
Properties defaultProperties ()
String documentRoot ()
String hostName ()
void initialize ()
boolean isDeployedAsServlet ()
void loadConfiguration ()
int operatingSystem ()
void setCommandLineArguments (String[] newCommandLineArguments)
synchronized void updateAllSystemProperties (NSNotification notification)
synchronized void updateSystemProperties (NSNotification n)

Static Public Member Functions

static ERXConfigurationManager defaultManager ()

Static Public Attributes

static final String ConfigurationDidChangeNotification = "ConfigurationDidChangeNotification"
static final Logger log = Logger.getLogger(ERXConfigurationManager.class)
static final int MacOSXOperatingSystem = 2
static final int SolarisOperatingSystem = 3
static final int UnknownOperatingSystem = 3
static final int WindowsOperatingSystem = 1

Protected Attributes

String _hostName
String documentRoot

Static Package Attributes

static ERXConfigurationManager defaultManager = null

Private Member Functions

 ERXConfigurationManager ()
NSArray monitoredProperties ()
void registerForFileNotification (String path, String callbackMethod)
void registerPropertiesTouchFiles ()

Static Private Member Functions

static String propertiesTouchFile ()

Private Attributes

Properties _commandLineArgumentProperties
String[] _commandLineArguments
Properties _defaultProperties
boolean _isInitialized = false
boolean _isRapidTurnAroundInitialized = false
NSArray _monitoredProperties
int _operatingSystem = 0


Constructor & Destructor Documentation

ERXConfigurationManager (  )  [private]

Private constructor to prevent instantiation from outside the class


Member Function Documentation

Properties applyConfiguration ( Properties  systemProperties  ) 

This will overlay the current system config files. It will then re-load the command line args.

Properties commandLineArgumentProperties (  ) 

Returns the command line arguments as Properties. ERXApplication#main sets this value.

Returns:
the command line arguments as a String[]
See also:
setCommandLineArguments

String [] commandLineArguments (  ) 

Returns the command line arguments. ERXApplication#main sets this value.

Returns:
the command line arguments as a String[]
See also:
setCommandLineArguments

void configureRapidTurnAround (  ) 

Sets up the system for rapid turnaround mode. It will watch the changes on Properties files in application and framework bundles and WebObjects.properties under the home directory. Rapid turnaround mode will only be enabled if there are such files available and system has WOCaching disabled.

static ERXConfigurationManager defaultManager (  )  [static]

Returns the single instance of this class

Returns:
the configuration manager

Properties defaultProperties (  ) 

Returns the command line arguments as Properties. ERXApplication#main sets this value.

Returns:
the command line arguments as a String[]
See also:
setCommandLineArguments

Path to the web server's document root. This implementation tries first to resolve the application.name()+ "DocumentRoot" property value, then the ERXDocumentRoot</> property before getting the DocumentRoot key in your WebServerConfig.plist in the JavaWebObjects bundle.

Returns:
to the web server's document root.

String hostName (  ) 

Gets the default host name for the current local host.

Returns:
host name or UnknownHost if the host is unknown.

void initialize (  ) 

Initializes the configuration manager. The framework principal ERXExtensions calls this method when the ERExtensions framework is loaded.

boolean isDeployedAsServlet (  ) 

Checks if the application is deployed as a servlet.

The current implementation only checks if the application is linked against JavaWOJSPServlet.framework.

Returns:
true if the application is deployed as a servlet

void loadConfiguration (  ) 

This will overlay the current system config files. It will then re-load the command line args.

NSArray monitoredProperties (  )  [private]

int operatingSystem (  ) 

static String propertiesTouchFile (  )  [static, private]

If set, touching this path will be used to signal a change to properties files.

void registerForFileNotification ( String  path,
String  callbackMethod 
) [private]

void registerPropertiesTouchFiles (  )  [private]

void setCommandLineArguments ( String[]  newCommandLineArguments  ) 

Sets the command line arguments. ERXApplication#main will call this method when the application starts up.

See also:
commandLineArguments

synchronized void updateAllSystemProperties ( NSNotification  notification  ) 

synchronized void updateSystemProperties ( NSNotification  n  ) 

Updates the configuration from the current configuration and posts ConfigurationDidChangeNotification. It also calls ERXLogger#configureLogging to reconfigure the logging system.

The configuration files: Properties and WebObjects.properties files are reloaded to the Java system properties by the same order to the when the system starts up. Then the command line arguments will be applied to the properties again so that the configuration will be consistent during the application lifespan.

This method is called when rapid turnaround is enabled and one of the configuration files changes.

Parameters:
n NSNotification object for the event (null means load all files)


Member Data Documentation

Properties _commandLineArgumentProperties [private]

Properties _defaultProperties [private]

String _hostName [protected]

holds the host name

boolean _isInitialized = false [private]

boolean _isRapidTurnAroundInitialized = false [private]

NSArray _monitoredProperties [private]

int _operatingSystem = 0 [private]

final String ConfigurationDidChangeNotification = "ConfigurationDidChangeNotification" [static]

Notification posted when the configuration is updated. The Java system properties is the part of the configuration.

Configuration manager singleton

String documentRoot [protected]

final Logger log = Logger.getLogger(ERXConfigurationManager.class) [static]

logging support

final int MacOSXOperatingSystem = 2 [static]

final int SolarisOperatingSystem = 3 [static]

final int UnknownOperatingSystem = 3 [static]

final int WindowsOperatingSystem = 1 [static]


The documentation for this class was generated from the following file:

Generated on Sat May 26 06:43:12 2012 for Project Wonder by  doxygen 1.5.8