Skip to content

Persistent Subsystem Configuration

Axel Faust edited this page Jul 21, 2019 · 2 revisions

The Alfresco Repository core architecture provides a framework for so-called subsystems. These are partially isolated contexts of the application context that configured / connects all Alfresco components. Subsystems can be used to encapsulate functionality which

  • may want to expose only specific interfaces / sub-sets of API, and keep implementation details hidden / inaccessible for other Spring beans
  • may need to support alternative implementations in Alfresco Enterprise Edition (e.g. Encrypted Content Store)
  • may need to be instantiated as a multitude of instances for integrations with different systems (e.g. Authentication)
  • may want to avoid polluting the global configuration space with finely grained configuration properties (e.g. Transformers)
  • may need to support limited reconfiguration and restart capabilities at runtime

The core architecture already provides for all the APIs and extension points to make this work, but the last item on that list has so far only been fully implemented in the Alfresco Enterprise Edition. Apart from a user interface to access and modify the subsystem configuration, the only thing missing in Alfresco core to make this work in Community Edition is a single, simple component to bridge the APIs, persist configuration changes and (indirectly) trigger restarts of the subsystem instances. OOTBee Support Tools provides that component in the form of a PropertyBackedBeanPersister.

Configuration

The PropertyBackedBeanPersister is active by default and typically does not need any configuration in Alfresco Community Edition. For users of Enterprise Edition, it will automatically detect the presence of an Enterprise Edition installation and disable itself during startup, showing the log message OOTBee Support Tools - PropertyBackedBeanPersister may conflict with JMX support in Enterprise Edition and will not be enabled. In this case, all runtime subsystem configuration continues to rely on the Enterprise Edition specific implementation, which is also tied to the JMX functionality. However, it can also be explicitly disabled using configuration in alfresco-global.properties.

The following configuration properties are supported by the PropertyBackedBeanPersister component, along with their default configuration:

# General activation flag
ootbee-support-tools.propertyBackedBeanPersister.enabled=true
# When loading runtime configuration from the database, also process Enterprise Edition style configuration values
ootbee-support-tools.propertyBackedBeanPersister.useLegacyJmxKeysForRead=true
# WHen removing / unsetting runtime configuration values from the database, also remove the corresponding Enterprise Edition style configuration values
ootbee-support-tools.propertyBackedBeanPersister.processLegacyJmxKeysOnRemoveProperties=true

The two settings relating to Enterprise Edition style configuration values are specifically meant for any users of Alfresco who may have downgraded an Enterprise Edition installation into a Community Edition one after termination of their Alfresco service and support subscription.

The PropertyBackedBeanPersister component makes use of an in-memory cache to optimise performance and support a potential deployment in a clustered setup, even though at this time no clustering support is available for Alfresco Community Edition either out-of-the-box or provided by a third party. The name of the cache is propertyBackedBeansPersisterSharedCache and it can be configured just like any other Alfresco cache using standard properties.

Persistence

The PropertyBackedBeanPersister uses the Alfresco AttributeService to persist configuration values in the Alfresco database. Specifically, all configuration values will be stored using the alf_prop_* tables in the database schema. Each attribute set via the AttributeService can consist of up to three keys to uniquely identify it. The PropertyBackedBeanPersister uses the following data points as its three keys:

  1. a static identifier prefix with the value of ootbee-support-tools.property-backed-beans
  2. the name / ID of the subsystem (or technically correct, the property backed bean)
  3. the name of the property

This structure differs from the structure of Alfresco Enteprise Edition properties, which only use two keys and don't store individual values, rather than the entire map of all properties for a specific subsystem. As a result, the both persistence schemes are not directly compatible and kept separate to avoid potential side effects, if at some point the Enterprise Edition functionality is moved into the core by Alfresco. A layer of compatibility logic handles read access / removal of Enterprise Edition style properties, and can be selectively disabled.

Runtime Configuration

Alfresco Community Edition does not provide a user interface to perform runtime changes of subsystem configuration properties. As a result, the only way to interact (indirectly) with the PropertyBackedBeanPersister is by either using the generic Java API of the Alfresco ChildApplicationContextFactory, DefaultChildApplicationContextManager, or other classes derived from / implementing the PropertyBackedBean interface - or use the "subsystems" plugin to the OOTBee Support Tools Command Console.