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

invalid reference
Configuration
object at the ConfigurationPersistencePlugin (or similar) level has restrictions and side effects:
  • The configuration may not be created yet
  • The configuration's properties might be stale
Implementations of these plugins should never attempt to make calls back into ConfigurationAdmin but instead should utilize an API-provided ConfigurationContext to perform allowed configuration operations.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    Given the pid of a configuration about to be deleted, perform processing before the configuration is deleted.
    void
    Given the ConfigurationContext of a configuration about to be written, perform processing before the results get stored.
    void
    Provide an initialization hook for synchronous resource allocation after a plugin is available to be called, unlike an OSGi life-cycle init() method, which is called prior to the service becoming available.
  • Method Details

    • initialize

      void initialize(Set<ConfigurationContext> state)
      Provide an initialization hook for synchronous resource allocation after a plugin is available to be called, unlike an OSGi life-cycle init() method, which is called prior to the service becoming available.
      Parameters:
      state - the current configuration state of the system.
    • handleStore

      void handleStore(ConfigurationContext context) throws IOException
      Given the ConfigurationContext of 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

      void handleDelete(String pid) throws IOException
      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.