Ejemplo n.º 1
0
        protected virtual void Init(ICacheSetting setting)
        {
            this.cacheName = setting.Name;
            string storageTypeName = null;

            if (setting.CacheStorage != null)
            {
                storageTypeName = setting.CacheStorage.TypeName;
            }
            this.CacheStorage = this.ObjectService.GetOrCreateObject <ICacheStorage>(storageTypeName);
            this.Interval     = setting.Interval;
        }
Ejemplo n.º 2
0
        void IInitializable <ICacheSetting> .Init(ICacheSetting setting)
        {
            this.CacheName = setting.Name;
            string serializerName = null;
            var    st             = setting.ConfigSetting.ToSetting <CacheSetting>("memcached");

            if (st != null)
            {
                serializerName = st.SerializerName;
            }
            var serializerFactory = ObjectService.GetObject <ISerializerFactory>();

            if (!string.IsNullOrEmpty(serializerName))
            {
                this.Serializer = serializerFactory.GetSerializer(serializerName);
            }
            if (this.Serializer == null)
            {
                this.Serializer = serializerFactory.Default;
            }
            this.InitInternal(st);
        }
Ejemplo n.º 3
0
 public CacheWrapper(IDistributedCache distributedCache, ICacheSetting cacheSetting)
 {
     DistributedCache = distributedCache;
     CacheSetting     = cacheSetting;
 }
Ejemplo n.º 4
0
 protected AsyncCacheRepositoryBase(ICacheSetting cacheSettings)
 {
     _cacheSettings = cacheSettings;
 }
Ejemplo n.º 5
0
 void IInitializable <ICacheSetting> .Init(ICacheSetting setting)
 {
     this.Init(setting);
 }