Package org.codice.felix.cm.internal
Interface ConfigurationPersistencePlugin
public interface ConfigurationPersistencePlugin
Provides synchronous interceptors for working with configuration data prior to writing or
deleting, and can influence the results of the config operations.
Interacting with a
object at the invalid reference
ConfigurationConfigurationPersistencePlugin
(or similar) level has restrictions and side effects:
- The configuration may not be created yet
- The configuration's properties might be stale
ConfigurationAdmin but instead should utilize an API-provided ConfigurationContext to perform allowed configuration operations.-
Method Summary
Modifier and TypeMethodDescriptionvoidhandleDelete(String pid) Given the pid of a configuration about to be deleted, perform processing before the configuration is deleted.voidhandleStore(ConfigurationContext context) Given theConfigurationContextof a configuration about to be written, perform processing before the results get stored.voidinitialize(Set<ConfigurationContext> state) Provide an initialization hook for synchronous resource allocation after a plugin is available to be called, unlike an OSGi life-cycleinit()method, which is called prior to the service becoming available.
-
Method Details
-
initialize
Provide an initialization hook for synchronous resource allocation after a plugin is available to be called, unlike an OSGi life-cycleinit()method, which is called prior to the service becoming available.- Parameters:
state- the current configuration state of the system.
-
handleStore
Given theConfigurationContextof a configuration about to be written, perform processing before the results get stored.- Parameters:
context- an object of relevant info that is safe to access during a config operation.- Throws:
IOException- to abort the configuration update operation and indicate to the user that it failed.IllegalStateException- if configuration data disappeared or felix internal data was otherwise corrupt.
-
handleDelete
Given the pid of a configuration about to be deleted, perform processing before the configuration is deleted.- Parameters:
pid- the service pid identifying the config object that will be deleted.- Throws:
IOException- to abort the configuration delete operation and indicate to the user that it failed.
-