Beispiel #1
0
        public void DoExpirations()
        {
            Hashtable liveCacheRepresentation = cacheOperations.GetCurrentCacheState();

            MarkAsExpired(liveCacheRepresentation);
            PrepareForSweep();
            SweepExpiredItemsFromCache(liveCacheRepresentation);
        }
Beispiel #2
0
        public void DoScavenging()
        {
            Hashtable liveCacheRepresentation = cacheOperations.GetCurrentCacheState();

            int currentNumberItemsInCache = liveCacheRepresentation.Count;

            if (scavengingPolicy.IsScavengingNeeded(currentNumberItemsInCache))
            {
                ResetScavengingFlagInCacheItems(liveCacheRepresentation);
                SortedList scavengableItems = SortItemsForScavenging(liveCacheRepresentation);
                RemoveScavengableItems(scavengableItems);
            }
        }