code: @Override
      public CONFIG applyConfigUpdate(final CONFIG config) throws CouldNotPerformException, InterruptedException {
          synchronized (CONFIG_LOCK) {
              try {
                  this.config = config;
                  configObservable.notifyObservers(config);
  
                  // detect scope change if instance is already active and reinit if needed.
                  try {
                      if (isActive() && !currentScope.equals(detectScope(config))) {
                          currentScope = detectScope();
                          reinit(currentScope);
                      }
                  } catch (CouldNotPerformException ex) {
                      throw new CouldNotPerformException("Could not verify scope changes!", ex);
                  }
  
                  try {
                      notifyConfigUpdate(config);
                  } catch (CouldNotPerformException ex) {
                      ExceptionPrinter.printHistory(new CouldNotPerformException("Could not notify config update!", ex), logger);
                  }
                  return this.config;
              } catch (CouldNotPerformException ex) {
                  throw new CouldNotPerformException("Could not apply config update!", ex);
              }
          }
      }
docs: {@inheritDoc}
  
  @param config {@inheritDoc}
  @return {@inheritDoc}
  @throws CouldNotPerformException {@inheritDoc}
  @throws InterruptedException {@inheritDoc}