public void destroy() throws Exception {
        while (!caches.isEmpty()) {
            for (Cache cache : caches.values()) {
                LifecycleUtils.destroy(cache);
            }
            caches.clear();
        }
    }
Cleanup method that first {@link LifecycleUtils#destroy destroys} all of it's managed caches and then
{@link java.util.Map#clear clears} out the internally referenced cache map.

@throws Exception if any of the managed caches can't destroy properly.
cache/src/main/java/org/apache/shiro/cache/AbstractCacheManager.java