Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

  • All DSpace configurations are loaded via Properties files
    • Note: Apache Commons Configuration does support other configuration sources such as XML configurations or database configurations, see its Overview documentation)
  • By default, all configuration files are automatically checked each minute for changes. If they have changed, they are automatically reloaded.
  • By default, only two configuration files are loaded into Apache Commons Configuration:
    • local.cfg (see documentation on local.cfg above)
    • dspace.cfg (NOTE: however that all module/*.cfg are loaded by dspace.cfg via "include=" statements at the end of that configuration file)
  • The configuration override scheme is defined as follows. Configurations specified in earlier locations will automatically override any later values:
    • System Properties (-D[setting]=[value]) override all other options
    • Environment Variables
    • local.cfg
    • dspace.cfg (and all module/*.cfg files) contain the default values for all settings

Advanced Topics

Configuration Interpolation

This is less important to normal users of DSpace, but may be of high interest to developers and some system administrators.

It's important to be aware of the fact that variables within the following types of configurations are now AUTOMATICALLY interpolated at runtime using Apache Commons Configuration (and our ConfigurationService). This means that variables (${setting}) are no longer filtered by Maven or Ant for any of the following configuration types:

  • Configuration files (namely local.cfg, dspace.cfg and modules/*.cfg)
  • Log4j settings (namely log4j.properties)
  • Spring XML configs (namely [dspace.dir]/config/spring/api/*.xml)

Java API Changes

ConfigurationManager vs ConfigurationService

In the DSpace 5 Java  API, we had two types of Configuration objects: org.dspace.coreConfigurationManager and org.dspace.services.ConfigurationService.

While the the ConfigurationManager still exists in the API (and is still called by some areas of the codebase), it is now a "wrapper" object. It simply wraps calls to the configured ConfigurationService.

As before, the default ConfigurationService is the org.dspace.servicemanager.config.DSpaceConfigurationService (in dspace-services).

The DSpaceConfigurationService has been updated/enhanced to utilize Apache Commons Configuration, and to better align its methods with the old ConfigurationManager class.   It also has added a new reloadConfig() method which can be called on demand to automatically reload all configurations.

PluginManager vs PluginService

In DSpace 5, the org.dspace.core.PluginManager class managed all DSpace "plugin" definitions (i.e. plugin.* settings in dspace.cfg). (SIDENOTE: these DSpace "plugin" definitions are simply Java interfaces, which are then mapped to classes which implement that plugin interface).

While this concept still exists, the PluginManager itself has been entirely replaced by a new org.dspace.core.service.PluginService.

The default PluginService is a new org.dspace.core.LegacyPluginServiceImpl class, which implements the functionality of the old PluginManager.