/// <summary> /// Load all the config sections from the configuration file. /// </summary> static private void LoadConfiguration(string cacheName) { try { CacheServerConfig[] configs = CacheConfigManager.GetConfiguredCaches(); //Just need to call the static block - stupid logik i know Alachisoft.NCache.Util.MiscUtil.RegisterCompactTypes(null); if (configs != null) { for (int i = 0; i < configs.Length; i++) { CacheServerConfig config = configs[i]; if (config != null && !String.IsNullOrEmpty(cacheName) && cacheName.ToLower().Equals(config.Name.ToLower())) { /// Until we completely move to using dom based configuration ///we have to convert it to string props string props = GetProps(config); // all but the listed cache types are loaded in s_caches table. string cacheId = config.Name.ToLower(); if (cacheInfo == null) { cacheInfo = new CacheInfo(); cacheInfo.Cache = new LeasedCache(props); cacheInfo.CacheName = cacheName; cacheInfo.CacheProps = config; } else { cacheInfo.CacheProps = config; } } } } } catch (Exception e) { string msg = String.Format("CacheServer failed to load configuration information, Error {0}", e.Message); AppUtil.LogEvent(msg, EventLogEntryType.Warning); } }
/// <summary> /// Load all the config sections from the configuration file. /// </summary> static private void LoadConfiguration(string cacheName) { try { CacheServerConfig[] configs = CacheConfigManager.GetConfiguredCaches(); Alachisoft.NCache.Util.MiscUtil.RegisterCompactTypes(); if (configs != null) { for (int i = 0; i < configs.Length; i++) { CacheServerConfig config = configs[i]; if (config != null && !String.IsNullOrEmpty(cacheName) && cacheName.ToLower().Equals(config.Name.ToLower())) { string props = GetProps(config); string cacheId = config.Name.ToLower(); if (cacheInfo == null) { cacheInfo = new CacheInfo(); cacheInfo.Cache = new LeasedCache(props); cacheInfo.CacheName = cacheName; cacheInfo.CacheProps = config; } else { cacheInfo.CacheProps = config; } } } } } catch (Exception e) { string msg = String.Format("CacheServer failed to load configuration information, Error {0}", e.Message); AppUtil.LogEvent(msg, EventLogEntryType.Warning); } }