public class DelegatingPersistenceManager extends WrappedPersistenceManager
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 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
| Constructor and Description |
|---|
DelegatingPersistenceManager(org.apache.felix.cm.PersistenceManager persistenceManager) |
| Modifier and Type | Method and Description |
|---|---|
void |
close() |
void |
delete(String pid) |
void |
store(String pid,
Dictionary properties) |
exists, getDictionaries, getInnerPersistenceManager, loadpublic DelegatingPersistenceManager(org.apache.felix.cm.PersistenceManager persistenceManager)
public void close()
throws Exception
close in interface AutoCloseableclose in class WrappedPersistenceManagerExceptionpublic void store(String pid, Dictionary properties) throws IOException
store in interface org.apache.felix.cm.PersistenceManagerstore in class WrappedPersistenceManagerIOExceptionpublic void delete(String pid) throws IOException
delete in interface org.apache.felix.cm.PersistenceManagerdelete in class WrappedPersistenceManagerIOExceptionThis work is licensed under a Creative Commons Attribution 4.0 International License.