class CacheManager {

    public void shutdown() {
        synchronized (CacheManager.class) {
            if (localTransactionsRecoveryThread != null && localTransactionsRecoveryThread.isAlive()) {
                localTransactionsRecoveryThread.interrupt();
                try {
                    localTransactionsRecoveryThread.join(LOCAL_TX_RECOVERY_THREAD_JOIN_TIMEOUT);
                } catch (InterruptedException ie) {
                    Thread.currentThread().interrupt();
                }
            }
            localTransactionsRecoveryThread = null;

            if (status.equals(Status.STATUS_SHUTDOWN)) {
                LOG.debug("CacheManager already shutdown");
                return;
            }

            if (registeredMgmtSvrBind != null) {
                ManagementServerLoader.unregister(registeredMgmtSvrBind, this);
                registeredMgmtSvrBind = null;
            }

            for (CacheManagerPeerProvider cacheManagerPeerProvider : cacheManagerPeerProviders.values()) {
                if (cacheManagerPeerProvider != null) {
                    cacheManagerPeerProvider.dispose();
                }
            }

            // cancel the cacheManager timer and all tasks
            if (cacheManagerTimer != null) {
                cacheManagerTimer.cancel();
                cacheManagerTimer.purge();
            }

            cacheManagerEventListenerRegistry.dispose();

            ALL_CACHE_MANAGERS.remove(this);

            for (Ehcache cache : ehcaches.values()) {
                if (cache != null) {
                    cache.dispose();
                }
            }
            if (defaultCache != null) {
                defaultCache.dispose();
            }
            status = Status.STATUS_SHUTDOWN;
            XARequestProcessor.shutdown();

            // only delete singleton if the singleton is shutting down.
            if (this == singleton) {
                singleton = null;
            }
            terracottaClient.shutdown();
            transactionController = null;
            removeShutdownHook();

            if (featuresManager != null) {
                featuresManager.dispose();
            }

            // release file lock on diskstore path
            if (diskStorePathManager != null) {
                diskStorePathManager.releaseLock();
            }

            final String name = CACHE_MANAGERS_REVERSE_MAP.remove(this);
            CACHE_MANAGERS_MAP.remove(name);
        }
    }

    public  CacheManager(Configuration configuration);
    public  CacheManager(String configurationFileName);
    public  CacheManager(URL configurationURL);
    public  CacheManager(InputStream configurationInputStream);
    public  CacheManager();

}