/* (non-Javadoc)
@see com.ibm.jaggr.service.cache.ICacheManager#shutdown()
424735
@Override
	public void shutdown(IAggregator aggregator) {
		for(IServiceRegistration reg : _serviceRegistrations) {
			reg.unregister();
		}
		_serviceRegistrations.clear();

		// Serialize the cache metadata one last time
		serializeCache();

		// avoid memory leaks caused by circular references
		_aggregator = null;
		_cache.set(null);
	}
1034032
public function shutdownObject()
    {
        $this->cache->set('parsedFormats', $this->parsedFormats);
        $this->cache->set('parsedFormatsIndices', $this->parsedFormatsIndices);
        $this->cache->set('localizedSymbols', $this->localizedSymbols);
    }
235819
public void shutdown() {
		synchronized (lock) {
			// first shutdown the thread pool
			ScheduledExecutorService es = this.executorService;
			if (es != null) {
				es.shutdown();
				try {
					es.awaitTermination(cleanupInterval, TimeUnit.MILLISECONDS);
				}
				catch (InterruptedException e) {
					// may happen
				}
			}

			entries.clear();
			jobRefHolders.clear();

			// clean up the all storage directories
			for (File dir : storageDirectories) {
				try {
					FileUtils.deleteDirectory(dir);
					LOG.info("removed file cache directory {}", dir.getAbsolutePath());
				}
				catch (IOException e) {
					LOG.error("File cache could not properly clean up storage directory: {}", dir.getAbsolutePath(), e);
				}
			}

			// Remove shutdown hook to prevent resource leaks
			ShutdownHookUtil.removeShutdownHook(shutdownHook, getClass().getSimpleName(), LOG);
		}
	}
963807
@Override
	public void shutdown() throws PluginException {
		if (storage != null) {
			try {
				storage.shutdown();
			} catch (PluginException pe) {
				log.error("Failed to shutdown storage: {}", pe.getMessage());
				throw pe;
			}
		}
		if (indexer != null) {
			try {
				indexer.shutdown();
			} catch (PluginException pe) {
				log.error("Failed to shutdown indexer: {}", pe.getMessage());
				throw pe;
			}
		}
	}
1373389
@Override
    public void shutdown() {
        try {
            verifyMaintainability();
        } catch (VerificationFailedException ex) {
            throw new RuntimeException("Can not shutdown " + this + "!", ex);
        }

        this.shutdownInitiated = true;
        try {
            dataObservable.shutdown();
        } finally {
            try {
                deactivate();
            } catch (CouldNotPerformException | InterruptedException ex) {
                ExceptionPrinter.printHistory("Could not shutdown " + this + "!", ex, logger);
            }
        }
    }
1124553
public synchronized void shutdown() {
    shutdown = true;
    for (int i = 0; i < threads.length; ++i) {
      if (threads[i] != null && threads[i].isAlive()) {
        threads[i].interrupt();
        threads[i] = null;
      }
    }
  }
1000288
static void shutDown() {
        ServerRequestQueue.shutDown();
        PrefHelper.shutDown();
        BranchUtil.shutDown();
        DeviceInfo.shutDown();

        // BranchStrongMatchHelper.shutDown();
        // BranchViewHandler.shutDown();
        // DeepLinkRoutingValidator.shutDown();
        // InstallListener.shutDown();
        // InstantAppUtil.shutDown();
        // IntegrationValidator.shutDown();
        // ShareLinkManager.shutDown();
        // UniversalResourceAnalyser.shutDown();

        // Release these contexts immediately.
        if (branchReferral_ != null) {
            branchReferral_.context_ = null;
            branchReferral_.currentActivityReference_ = null;
        }

        // Reset all of the statics.
        branchReferral_ = null;
        customReferrableSettings_ = CUSTOM_REFERRABLE_SETTINGS.USE_DEFAULT;
        bypassCurrentActivityIntentState_ = false;
        disableInstantDeepLinking = false;
        isActivityLifeCycleCallbackRegistered_ = false;
        isAutoSessionMode_ = false;

        isForcedSession_ = false;
        isSimulatingInstalls_ = false;

        checkInstallReferrer_ = true;
    }
278705
public void setShutdown(java.util.Collection<String> shutdown) {
        if (shutdown == null) {
            this.shutdown = null;
            return;
        }

        this.shutdown = new com.amazonaws.internal.SdkInternalList<String>(shutdown);
    }
1328966
public void shutdown() {

		if (!this.shutdownStarted.compareAndSet(false, true)) {
			return;
		}

		LOG.info("Shutting down TaskManager");
		
		// first, stop the heartbeat thread and wait for it to terminate
		this.heartbeatThread.interrupt();
		try {
			this.heartbeatThread.join(1000);
		} catch (InterruptedException e) {}

		// Stop RPC proxy for the task manager
		RPC.stopProxy(this.jobManager);

		// Stop RPC proxy for the global input split assigner
		RPC.stopProxy(this.globalInputSplitProvider);

		// Stop RPC proxy for the lookup service
		RPC.stopProxy(this.lookupService);

		// Stop RPC proxy for accumulator reports
		RPC.stopProxy(this.accumulatorProtocolProxy);

		// Shut down the own RPC server
		this.taskManagerServer.stop();

		// Stop profiling if enabled
		if (this.profiler != null) {
			this.profiler.shutdown();
		}

		// Shut down the network channel manager
		this.channelManager.shutdown();

		// Shut down the memory manager
		if (this.ioManager != null) {
			this.ioManager.shutdown();
		}

		if (this.memoryManager != null) {
			this.memoryManager.shutdown();
		}

		this.fileCache.shutdown();

		// Shut down the executor service
		if (this.executorService != null) {
			this.executorService.shutdown();
			try {
				this.executorService.awaitTermination(5000L, TimeUnit.MILLISECONDS);
			} catch (InterruptedException e) {
				if (LOG.isDebugEnabled()) {
					LOG.debug(e);
				}
			}
		}

		this.shutdownComplete = true;
	}
155329
@Override public void shutdown() {
        if (isStarted()) {
            future.cancel(true);
            executorService.shutdown();
            future = null;
            executorService = null;
            watchedFiles = ImmutableSet.of();
            callback = null;
            metadataCacheRef.set(ImmutableMap.of());
            stats.clear();
        }
    }
1291143
public synchronized final void shutdown() throws RepositoryException {
        preShutdown();

        delegateWriter = NoOpQueryIndexWriter.INSTANCE;
        try {
            // Shutdown each of the provided indexes ...
            for (Map<String, AtomicIndex> byWorkspaceName : providedIndexesByWorkspaceNameByIndexName.values()) {
                for (AtomicIndex provided : byWorkspaceName.values()) {
                    provided.shutdown(false);
                }
            }
        } finally {
            providedIndexesByWorkspaceNameByIndexName.clear();
            providedIndexesByIndexNameByWorkspaceName.clear();
            postShutdown();
        }
    }
564775
@Override
    public void close() {
        if (!this.closed.getAndSet(true)) {
            this.cache.close();
            synchronized (this.segmentCaches) {
                this.segmentCaches.clear();
            }
        }
    }
639303
public static void shutdown() {
        if (MetricsManager.executorService != null) {
            MetricsManager.executorService.shutdown();
            MetricsManager.executorService = null;
        }
        if (MetricsManager.instance != null) {
            MetricsManager.instance = null;
            MetricsManager.poolManager.shutdown();
            MetricsManager.poolManager = null;
            MetricsManager.httpClient = null;
            MetricsManager.rootMetricsLogger = null;
        }
    }
839187
@Override
	public void shutdown() {
		if (collection != null) {
			try {
				collection.shutdown();
			} catch (IOException e) {
				LOGGER.severe("FAILED collection shutdown" + e.getMessage());
			}
		}
		if (exclusionFactory != null) {
			exclusionFactory.shutdown();
		}
	}
484630
public void shutdown() {
        final Connection connection;
        synchronized (this) {
            if(shutdown) return;
            shutdown = true;
            connection = this.connection;
            if(connectTask != null) {
                connectTask.shutdown();
            }
        }
        if (connection != null) {
            connection.closeAsync();
        }
    }
1095712
public synchronized void shutdown(){

		if (!this.poolShuttingDown){
			logger.info("Shutting down connection pool...");
			this.poolShuttingDown = true;
			this.shutdownStackTrace = captureStackTrace(SHUTDOWN_LOCATION_TRACE);
			this.keepAliveScheduler.shutdownNow(); // stop threads from firing.
			this.maxAliveScheduler.shutdownNow(); // stop threads from firing.
			this.connectionsScheduler.shutdownNow(); // stop threads from firing.
			this.asyncExecutor.shutdownNow();

			try {
				this.connectionsScheduler.awaitTermination(5, TimeUnit.SECONDS);

				this.maxAliveScheduler.awaitTermination(5, TimeUnit.SECONDS);
				this.keepAliveScheduler.awaitTermination(5, TimeUnit.SECONDS);
				this.asyncExecutor.awaitTermination(5, TimeUnit.SECONDS);
				
				if (this.closeConnectionExecutor != null){
					this.closeConnectionExecutor.shutdownNow();
					this.closeConnectionExecutor.awaitTermination(5, TimeUnit.SECONDS);
				}
				
			} catch (InterruptedException e) {
				// do nothing
			}
			this.connectionStrategy.terminateAllConnections();
			unregisterDriver();
			registerUnregisterJMX(false);
			if (finalizableRefQueue != null) {
				finalizableRefQueue.close();
			}
			    logger.info("Connection pool has been shutdown.");
		}
	}
691168
public final void shutdown() throws IOException {
    if (this.shutdown) {
      return;
    }
    this.shutdown0();
    this.shutdown = true;
    this.connector.shuttingDown();
    this.connector.quitAllSessions();
    this.connector.stop();
    this.memcachedHandler.stop();
    XMemcachedMbeanServer.getInstance().shutdown();
    if (AddrUtil.isEnableShutDownHook() && !this.isHutdownHookCalled) {
      try {
        Runtime.getRuntime().removeShutdownHook(this.shutdownHookThread);
      } catch (Exception e) {
        // ignore;
      }
    }
  }