Apache.Shiro.Cache.DictionaryCacheManager.GetCache C# (CSharp) Method

GetCache() public method

public GetCache ( string cacheName ) : ICache
cacheName string
return ICache
        public ICache GetCache(string cacheName)
        {
            if (string.IsNullOrEmpty(cacheName))
            {
                throw new CacheException("Cache name cannot be null or empty");
            }

            lock (_caches)
            {
                if (_caches.ContainsKey(cacheName))
                {
                    return _caches[cacheName];
                }

                ICache cache = new DictionaryCache();
                _caches.Add(cacheName, cache);

                return cache;
            }
        }