Esempio n. 1
0
        protected override IDictionary <string, IAlbianCached> ParserCached(XmlNode node)
        {
            IDictionary <string, IAlbianCached> dic = new Dictionary <string, IAlbianCached>();

            XmlNodeList         memcacehdNodes = node.SelectNodes("Memcached/Group");
            IList <ICacheGroup> distGroups     = ParserMemcachedGroups(memcacehdNodes);

            foreach (var group in distGroups)
            {
                IAlbianCached cached = new DistributedAlbianCached(group.Name, group.Servers.Split(new[] { ';' }, StringSplitOptions.RemoveEmptyEntries));
                dic.Add(group.Name, cached);
            }

            XmlNodeList         localNodes  = node.SelectNodes("Local/Group");
            IList <ICacheGroup> localGroups = ParserLocalGroups(localNodes);

            foreach (var group in localGroups)
            {
                IAlbianCached cached = new AlbianCached(group.Name, group.Size);
                dic.Add(group.Name, cached);
            }
            return(dic);
        }
Esempio n. 2
0
        protected override IDictionary<string, IAlbianCached> ParserCached(XmlNode node)
        {
            IDictionary<string, IAlbianCached> dic = new Dictionary<string, IAlbianCached>();

            XmlNodeList memcacehdNodes = node.SelectNodes("Memcached/Group");
            IList<ICacheGroup> distGroups = ParserMemcachedGroups(memcacehdNodes);
            foreach (var group in distGroups)
            {
                IAlbianCached cached = new DistributedAlbianCached(group.Name, group.Servers.Split(new[] { ';' },StringSplitOptions.RemoveEmptyEntries));
                dic.Add(group.Name, cached);
            }

            XmlNodeList localNodes = node.SelectNodes("Local/Group");
            IList<ICacheGroup> localGroups = ParserLocalGroups(localNodes);
            foreach (var group in localGroups)
            {
                IAlbianCached cached = new AlbianCached(group.Name, group.Size);
                dic.Add(group.Name, cached);
            }
            return dic;
        }