code: @Override
      public void configurationEvent(ConfigurationEvent event) {
          LOGGER.debug("event received : " + event.getPid() + " - " + event.getType());
          try {
              lock.lock();
              final List<InstanceDeclaration> impacted
                      = getDeclarationsByConfiguration(event.getPid(), event.getFactoryPid());
  
              if (impacted.isEmpty()) {
                  return;
              }
  
              switch (event.getType()) {
                  case ConfigurationEvent.CM_DELETED:
                      for (InstanceDeclaration declaration : impacted) {
                          LOGGER.info("Configuration " + event.getPid() + " deleted");
                          declaration.dispose(event.getPid());
                      }
                      break;
                  case ConfigurationEvent.CM_UPDATED:
                      for (InstanceDeclaration declaration : impacted) {
                          final Configuration configuration = find(event.getPid());
                          if (configuration == null) {
                              LOGGER.error("Weird case, a matching declaration was found, but cannot be found a second " +
                                      "times, may be because of rapid changes in the config admin");
                          } else {
                              declaration.attachOrUpdate(configuration);
                          }
                      }
  
                      break;
              }
          } finally {
              lock.unlock();
          }
  
      }
docs: Receives a configuration event.
  
  @param event the event.