
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 |
| ERXConfigurationManager | ( | ) | [private] |
Private constructor to prevent instantiation from outside the class
| 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.
| String [] commandLineArguments | ( | ) |
Returns the command line arguments. ERXApplication#main sets this value.
| 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
| Properties defaultProperties | ( | ) |
Returns the command line arguments as Properties. ERXApplication#main sets this value.
| String documentRoot | ( | ) |
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.
| String hostName | ( | ) |
Gets the default host name for the current local host.
| 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.
| 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 registerPropertiesTouchFiles | ( | ) | [private] |
| void setCommandLineArguments | ( | String[] | newCommandLineArguments | ) |
Sets the command line arguments. ERXApplication#main will call this method when the application starts up.
| 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.
| n | NSNotification object for the event (null means load all files) |
Properties _commandLineArgumentProperties [private] |
String [] _commandLineArguments [private] |
Properties _defaultProperties [private] |
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.
ERXConfigurationManager defaultManager = null [static, package] |
Configuration manager singleton
String documentRoot [protected] |
final int MacOSXOperatingSystem = 2 [static] |
final int SolarisOperatingSystem = 3 [static] |
final int UnknownOperatingSystem = 3 [static] |
final int WindowsOperatingSystem = 1 [static] |
1.5.8