예제 #1
0
        protected override ICacheGroup ParserLocalGroup(XmlNode node)
        {
            if (ValidateService.IsNull(node))
            {
                throw new ArgumentNullException("node");
            }
            object oName;
            object oSize;

            if (!XmlFileParserService.TryGetAttributeValue(node, "Name", out oName))
            {
                if (null != _logger)
                {
                    _logger.Error("no the name of cache group.");
                }
                return(null);
            }
            ICacheGroup group = new CacheGroup();

            group.Name = oName.ToString();
            if (!XmlFileParserService.TryGetAttributeValue(node, "Size", out oSize))
            {
                if (null != _logger)
                {
                    _logger.Error("no the servers of cache group.");
                }
                return(null);
            }
            group.Size = int.Parse(oSize.ToString());
            return(group);
        }
예제 #2
0
 protected override ICacheGroup ParserMemcachedGroup(XmlNode node)
 {
     if(ValidateService.IsNull(node))
     {
         throw new ArgumentNullException("node");
     }
     object oName;
     object oServers;
     if(!XmlFileParserService.TryGetAttributeValue(node, "Name", out oName))
     {
         if(null != _logger)
         {
             _logger.Error("no the name of cache group.");
         }
         return null;
     }
     ICacheGroup group = new CacheGroup();
     group.Name = oName.ToString();
     if (!XmlFileParserService.TryGetAttributeValue(node, "Servers", out oServers))
     {
         if (null != _logger)
         {
             _logger.Error("no the servers of cache group.");
         }
         return null;
     }
     group.Servers = oServers.ToString();
     return group;
 }