示例#1
0
        public Cache(string name, CacheConfiguration configuration)
        {
            if (configuration == null)
            {
                throw new NullReferenceException("CacheConfiguration is NULL."); 
            }

            if (configuration.Logger != null)
            {
                configuration.Logger.Log("Create a new cache: " + name, Category.Info, Priority.High);
            }

            this.proxy = new CacheProxy(name, configuration);
        }
示例#2
0
        public ICache Create(string name, CacheConfiguration configuration)
        {
            if (this.Contains(name) != null)
            {
                return null;
            }

            if (configuration == null)
            {
                throw new NullReferenceException("configuration is NULL.");
            }

            ICache cache = new Cache(name, configuration);

            this.caches.Add(cache);

            return cache;
        }
示例#3
0
 public void Adjust(CacheConfiguration configuration)
 {
     this.proxy.Adjust(configuration);
 }
示例#4
0
 protected abstract void DoAdjust(CacheConfiguration configuration);
示例#5
0
        public void Adjust(CacheConfiguration configuration)
        {
            this.DoAdjust(configuration);

            this.Signal();
        }
示例#6
0
 private void ConfigureHierarchy(CacheConfiguration configuration)
 {
     this.scheduler = SchedulerBase.Factory.Create(configuration.SchedulerConfiguration, configuration.Logger);
 }
示例#7
0
 protected override void DoAdjust(CacheConfiguration configuration)
 {
     this.scheduler.Adjust(configuration.SchedulerConfiguration);
 }
示例#8
0
 public CacheProxy(string name, CacheConfiguration configuration)
     : base(name)
 {
     this.ConfigureHierarchy(configuration);
 }