code: public void removeResources(L location) {
          status.assertRunning(getClass(), "removeResources()");
          try (S session = openSession()) {
              // we must not alter the resource manager while a discovery scan is in progress
              WriteLock lock = EndpointService.this.discoveryScanRWLock.writeLock();
              lock.lock();
              try {
                  List<Resource<L>> removed = getResourceManager().removeResources(location,
                          session.getLocationResolver());
                  inventoryListenerSupport.fireResourcesRemoved(removed);
              } finally {
                  lock.unlock();
              }
          } catch (Exception e) {
              LOG.errorCouldNotAccess(this, e);
          }
      }
docs: Remove resources matching the given {@code location} and all their direct and indirect descendant resources.
  
  Note that this method may block if a discovery scan is currently in progress. The removal will occur when
  the discovery scan finishes - only then will this method return.
  
  @param location a location that can contain wildcards