Stop the CachedDirectoryLookupService.

It is thread safe.
517103
@Override
    public void stop(){
        if (this.isStarted == false)
            return;
        synchronized (this) {
            if (this.isStarted == true) {
                getCache().refresh();
                this.isStarted = false;
            }
        }
    }
45293
public void stop() {
        try {
            safeClose(myServerSocket);
            closeAllConnections();
            myThread.join();
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
823628
public final void stop()
    {
        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(this, tc, "stop");

        synchronized (alarmLock)
        {
            if (enabled)
            {
                loaderStopTime = timeNow();
                enabled = false;
                shutdown = true;
            }
            if (loaderAlarm != null)
            {
                loaderAlarm.cancel();
                loaderAlarm = null;
            }
        }

        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(this, tc, "stop");
    }
488717
@Override
    public void stop(){
        if (isStarted) {
            synchronized (this) {
                if (isStarted) {
                    if (getRegistrationService() instanceof Closable) {
                        ((Closable) getRegistrationService()).stop();
                    }
                    isStarted = false;
                }
            }
        }

    }
230854
@Override
    public boolean stop() {
        synchronized(MetricCollectorSupport.class) {
            if (uploaderThread != null) {
                uploaderThread.cancel();
                uploaderThread.interrupt();
                uploaderThread = null;
                if (singleton == this) { // defensive check
                    singleton = null;
                }
                return true;
            }
        }
        return false;
    }
1152544
private void stopThreadPool(ExecutorService threadPool) {
        LibraryUtils.checkCondition(threadPool == null, "Thread pool is null when calling stop");

        if (threadPool.isShutdown()) {
            logger.debug(threadPool.toString() + " is already stopped.");

        } else {

            logger.debug(threadPool.toString() + " is about to shutdown.");
            threadPool.shutdown(); // Shutdown thread pool

            try { // Wait for shutdown
                threadPool.awaitTermination(config.getThreadTerminationDelaySeconds(), TimeUnit.SECONDS);
            } catch (InterruptedException e) {
                logger.debug("Wait thread pool termination is interrupted.");
            }

            if (!threadPool.isShutdown()) { // ShutdownNow after waiting
                logger.debug(threadPool.toString() + " is force to shutdown now.");
                threadPool.shutdownNow();
            }

            logger.debug(threadPool.toString() + " is stopped.");
        }
    }
710919
@Override
   public final void stop() {
      // Trying to stop() from FAILED is valid, but may not work
      boolean failed;

      synchronized (this) {
         try {
            while (state == ComponentStatus.STOPPING) {
               wait();
            }
            if (!state.stopAllowed()) {
               getLog().debugf("Ignoring call to stop() as current state is %s", state);
               return;
            }

            failed = state == ComponentStatus.FAILED;
            state = ComponentStatus.STOPPING;
         } catch (InterruptedException e) {
            throw new CacheException("Interrupted waiting for the component registry to stop");
         }
      }

      preStop();

      try {
         internalStop();

         postStop();
      } catch (Throwable t) {
         if (failed) {
            getLog().failedToCallStopAfterFailure(t);
         } else {
            handleLifecycleTransitionFailure(t);
         }
      } finally {
         synchronized (this) {
            state = ComponentStatus.TERMINATED;
         }
      }
   }
1336317
public void interrupt() {
		interrupted.set(true);
		ExecutorService pool = ConcurrencyTools.getThreadPool();
		pool.shutdownNow();
		try {
			DomainProvider domainProvider = DomainProviderFactory.getDomainProvider();
			if (domainProvider instanceof RemoteDomainProvider){
				RemoteDomainProvider remote = (RemoteDomainProvider) domainProvider;
				remote.flushCache();
			}
		} catch (IOException e) {
			// If errors occur, the cache should be empty anyways
		}

	}
179886
def clearCache():
		
		if os.path.exists(CachedDataManager._cacheDir()) == True:
			shutil.rmtree(CachedDataManager._cacheDir())
714393
@Invalidate
    public void stop() {
        if (registration != null) {
            registration.unregister();
            registration = null;
        }
        if (manager != null) {
            manager.removeCache(WISDOM_KEY);
        }
    }
897202
@Override
    public void stop(){
        if (isStarted.compareAndSet(true,false)) {
            this.syncService.shutdown();
            getCache().clear();
            getMetadataKeyCache().clear();
        }
    }
474599
void close(boolean cleanCache) {
        if (!this.closed.getAndSet(true)) {
            // Close storage reader (and thus cancel those reads).
            if (cleanCache) {
                this.executor.execute(() -> {
                    removeAllCacheEntries();
                    log.info("{}: Closed.", this.traceObjectId);
                });
            } else {
                log.info("{}: Closed (no cache cleanup).", this.traceObjectId);
            }
        }
    }
979147
def stop(self):
        
        if getattr(self, "_jsc", None):
            try:
                self._jsc.stop()
            except Py4JError:
                # Case: SPARK-18523
                warnings.warn(
                    'Unable to cleanly shutdown Spark JVM process.'
                    ' It is possible that the process has crashed,'
                    ' been killed or may also be in a zombie state.',
                    RuntimeWarning
                )
            finally:
                self._jsc = None
        if getattr(self, "_accumulatorServer", None):
            self._accumulatorServer.shutdown()
            self._accumulatorServer = None
        with SparkContext._lock:
            SparkContext._active_spark_context = None
1342873
public void stop() {
        if (cacheDispatcher != null) {
            cacheDispatcher.quit();
            addMarker(EVENT_CACHE_DISPATCHER_STOP, cacheDispatcher);

        }
        for (NetworkDispatcher netDispatcher : networkDispatchers) {
            if (netDispatcher != null) {
                netDispatcher.quit();
                addMarker(EVENT_NETWORK_DISPATCHER_STOP, netDispatcher);

            }
        }
    }
697226
public void stopThread(StoppableThreadCache threadCache)
  {
    if (tc.isEntryEnabled())
      SibTr.entry(tc, "stopThread", threadCache);
    
    synchronized (_messageProcessor.getDestinationManager().deletionThreadLock)
    {    
      // Allow the thread to finish the immediate job in hand before
      // returning.
      //set the thread to stopping, so that it'll stop if in progress
      // and no new instances will be started         
      setStopping();
  
      // Now wait till the thread's gone
      while (isRunning())
      {
        try
        {
          // wait for thread to end
          // I put a timeout on this - to handle the case where we've hung
          // in delete processing. The best thing in such a case is probably
          // to allow the whole process to exit.
  
          // But is 5 secs right? - NY
          _messageProcessor.getDestinationManager().deletionThreadLock.wait(5000);
          if (Thread.holdsLock(asynchLock)) asynchLock.wait(5000);
        }
        catch (InterruptedException iex)
        {
          // No FFDC code needed
          SibTr.exception(tc, iex);
        }
      }
    }
    
    // Remove this thread from the thread cache
    threadCache.deregisterThread(this);
   
    if (tc.isEntryEnabled())
      SibTr.exit(tc, "stopThread");
  }
1016511
def close(self, for_shutdown=False, **_kwargs):
        
        if for_shutdown:
            super(PySOAPyLibMCCache, self).close()
279214
private void stopServices() {
        // Stop services in reverse order of starting.
        m_logger.debug("Stopping all services");
        ListIterator<Service> iter = m_startedServices.listIterator(m_startedServices.size());
        while (iter.hasPrevious()) {
            Service service = iter.previous();
            m_logger.debug("Stopping service: " + service.getClass().getSimpleName());
            service.stop();
            iter.remove();
        }
        m_initializedServices.clear();
        m_storageServices.clear();
    }