Ejemplo n.º 1
0
        /// <summary>
        /// A factory method to create a MemoryStore.
        /// </summary>
        /// <param name="cache">Parent Cache.</param>
        /// <param name="diskStore">Associated Disk store.</param>
        /// <returns>Nouvelle instance.</returns>
        internal static MemoryStore Create(IEhcache cache, IStore diskStore)
        {
            MemoryStore memoryStore          = null;
            MemoryStoreEvictionPolicy policy = cache.MemoryStoreEvictionPolicy;

            switch (policy)
            {
            case MemoryStoreEvictionPolicy.Lru:
                memoryStore = new LruMemoryStore(cache, diskStore);
                break;

            default:
                throw new NotImplementedException();
            }

            return(memoryStore);
        }
Ejemplo n.º 2
0
 /// <summary>
 /// Crée une nouvelle instance.
 /// </summary>
 /// <param name="store">Memory Store.</param>
 /// <param name="maximumSize">Taille maximum.</param>
 public SpoolingLruDictionary(LruMemoryStore store, int maximumSize)
     : base()
 {
     _store           = store;
     this.MaximumSize = maximumSize;
 }