Class DelegatingPersistenceManager
- All Implemented Interfaces:
AutoCloseable,org.apache.felix.cm.PersistenceManager
DelegatingPersistenceManager is responsible for iterating over relevant configuration
plugin points prior to moving the configs to the inner PersistenceManager.
Read locks are maintained during configuration persistence and removal so that initializing plugins do not miss configuration data.
By implementing ServiceTrackerCustomizer callbacks are provided for plugin
initialization to occur. The implementation is expressed in an inner class DelegatingPersistenceManager.PluginTrackerCustomizer.
Plugin initialization delivers the list of all known configurations to the plugins so they can
prepare for future updates and deletions. The serviceStartingLock ensures no additional
configuration is persisted or removed while configuration plugins are being initialized, the
consequences of which could mean plugins miss configuration and fall out of sync with the data
cache.
For plugin initialization, we read configuration data from the inner persistence manager
directly to avoid lock contention with the caching layer that Felix adds in the ConfigurationManager. This means reading all the config admin
configuration data from disk every time a ConfigurationPersistencePlugin needs to
initialize.
Also relevant: https://github.com/codice/ddf/pull/2523#discussion_r150092423
See FELIX-4005 & FELIX-4556. This class cannot utilize Java 8 language constructs due to maven bundle plugin 2.3.7
-
Field Summary
Fields inherited from interface org.apache.felix.cm.PersistenceManager
PROPERTY_NAME -
Constructor Summary
ConstructorsConstructorDescriptionDelegatingPersistenceManager(org.apache.felix.cm.PersistenceManager persistenceManager) -
Method Summary
Methods inherited from class org.codice.felix.cm.file.WrappedPersistenceManager
exists, getDictionaries, getInnerPersistenceManager, load
-
Constructor Details
-
DelegatingPersistenceManager
public DelegatingPersistenceManager(org.apache.felix.cm.PersistenceManager persistenceManager)
-
-
Method Details
-
close
- Specified by:
closein interfaceAutoCloseable- Overrides:
closein classWrappedPersistenceManager- Throws:
Exception
-
store
- Specified by:
storein interfaceorg.apache.felix.cm.PersistenceManager- Overrides:
storein classWrappedPersistenceManager- Throws:
IOException
-
delete
- Specified by:
deletein interfaceorg.apache.felix.cm.PersistenceManager- Overrides:
deletein classWrappedPersistenceManager- Throws:
IOException
-