* If profiling properties are updated, this method is called to update
* the profile states.
*/
public static void initProps() {
String prop;
FrameworkDebugOptions dbgOptions = null;
// if osgi.debug is not available, don't force DebugOptions
// to init as this variable may be set later on where
// DebugOptions will succeed.
if (FrameworkProperties.getProperty("osgi.debug") != null) { //$NON-NLS-1$
dbgOptions = FrameworkDebugOptions.getDefault();
if (dbgOptions != null) {
STARTUP = dbgOptions.getBooleanOption(OPTION_STARTUP, false);
BENCHMARK = dbgOptions.getBooleanOption(OPTION_BENCHMARK, false);
DEBUG = dbgOptions.getBooleanOption(OPTION_DEBUG, false);
if (profileLogger == null)
profileLoggerClassName = dbgOptions.getOption(OPTION_IMPL);
}
}
// System properties will always override anything in .options file
if ((prop = FrameworkProperties.getProperty(PROP_STARTUP)) != null) {
STARTUP = Boolean.valueOf(prop).booleanValue();
if (dbgOptions != null)
dbgOptions.setOption(OPTION_STARTUP, new Boolean(STARTUP).toString());
}
if ((prop = FrameworkProperties.getProperty(PROP_BENCHMARK)) != null) {
BENCHMARK = Boolean.valueOf(prop).booleanValue();
if (dbgOptions != null)
dbgOptions.setOption(OPTION_BENCHMARK, new Boolean(BENCHMARK).toString());
}
if ((prop = FrameworkProperties.getProperty(PROP_DEBUG)) != null) {
DEBUG = Boolean.valueOf(prop).booleanValue();
if (dbgOptions != null)
dbgOptions.setOption(OPTION_DEBUG, new Boolean(DEBUG).toString());
}
if (profileLogger == null) {
if ((prop = FrameworkProperties.getProperty(PROP_IMPL)) != null) {
profileLoggerClassName = prop;
if (dbgOptions != null)
dbgOptions.setOption(OPTION_IMPL, profileLoggerClassName);
}
} else {
profileLogger.initProps();
}
}