code: @Override
      public final boolean removeExistingConfigurations(String filter) throws Exception {
          final boolean trace = TraceComponent.isAnyTracingEnabled();
  
          ConfigurationAdmin configAdmin = configAdminRef.getService();
          Configuration[] existingConfigurations = configAdmin.listConfigurations(filter);
          if (existingConfigurations != null)
              for (Configuration config : existingConfigurations) {
                  Dictionary<?, ?> cfgProps = config.getProperties();
                  // Don't remove configuration that came from server.xml
                  if (cfgProps != null && FILE.equals(cfgProps.get(CONFIG_SOURCE))) {
                      if (trace && tc.isDebugEnabled())
                          Tr.debug(tc, "configuration found in server.xml: ", config.getPid());
                      return false;
                  } else {
                      if (trace && tc.isDebugEnabled())
                          Tr.debug(tc, "removing", config.getPid());
                      config.delete();
                  }
              }
  
          return true;
      }
docs: This method looks for existing configurations and removes them unless they came
  from server.xml
  
  We can distinguish by checking for the presence of a property named "config.source"
  which is set to "file" when the configuration originates from server.xml.
  
  @param filter used to find existing configurations.
  @return true if all configurations were removed or did not exist to begin with, otherwise false.
  @throws Exception if an error occurs.