Beispiel #1
0
        //@SuppressWarnings("unchecked")
        /// <summary>
        /// Total Cached Elements
        /// </summary>
        /// <returns>count</returns>
        public int GetElementCount()
        {
            int total = 0;

            for (int i = 0; i < instances.Count; i++)
            {
                ICacheInterface stored = (ICacheInterface)instances[i];
                if (stored != null && stored.Size() > 0)
                {
                    log.Fine(stored.ToString());
                    //if(stored.GetType().ToString() == "VAdvantage.Classes.CCache")
                    if (stored != null && stored.GetType().ToString().Contains("VAdvantage.Classes.CCache"))
                    {
                        //total += ((CCache)stored).sizeNoExpire();
                        total += stored.SizeNoExpire();
                    }
                    else
                    {
                        total += stored.Size();
                    }
                }
            }
            return(total);
        }
Beispiel #2
0
        /// <summary>
        /// Reset All registered Cache
        /// </summary>
        /// <returns>number of deleted cache entries</returns>
        public int Reset()
        {
            int counter = 0;
            int total   = 0;

            for (int i = 0; i < instances.Count; i++)
            {
                ICacheInterface stored = (ICacheInterface)instances[i];
                if (stored != null && stored.Size() > 0)
                {
                    log.Fine(stored.ToString());
                    total += stored.Reset();
                    counter++;
                }
            }
            log.Info("#" + counter + " (" + total + ")");
            return(total);
        }