Exemplo n.º 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);
        }
Exemplo n.º 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;
        }
Exemplo n.º 3
0
 public void Adjust(CacheConfiguration configuration)
 {
     this.proxy.Adjust(configuration);
 }
Exemplo n.º 4
0
 protected abstract void DoAdjust(CacheConfiguration configuration);
Exemplo n.º 5
0
        public void Adjust(CacheConfiguration configuration)
        {
            this.DoAdjust(configuration);

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