private void removeCache ( final String alias , final boolean removeFromConfig ) { statusTransitioner . checkAvailable ( ) ; final CacheHolder cacheHolder = caches . remove ( alias ) ; if ( cacheHolder != null ) { final InternalCache < ? , ? > ehcache = cacheHolder . retrieve ( cacheHolder . keyType , cacheHolder . valueType ) ; if ( ehcache != null ) { if ( removeFromConfig ) { configuration . removeCacheConfiguration ( alias ) ; } if ( ! statusTransitioner . isTransitioning ( ) ) { for ( CacheManagerListener listener : listeners ) { listener . cacheRemoved ( alias , ehcache ) ; } } ehcache . close ( ) ; closeEhcache ( alias , ehcache ) ; } LOGGER . info ( "Cache '{}' removed from {}." , alias , simpleName ) ; } }
Closes and removes a cache by alias from this cache manager .