public RequestSummaryData GetRequestSummaryData(HttpContext context)
        {
            if (null == context)
                throw new ArgumentNullException("context");

            RequestSummaryData data = null;

            try
            {
              // Create the directory if it doesn't already exist.
              if (!Directory.Exists(Path.Combine(Statistic.GetStatisticsPath(context), "Requests")))
                Directory.CreateDirectory(Path.Combine(Statistic.GetStatisticsPath(context), "Requests"));

              lock (lockObject)
              {
                string fileName = Path.Combine(Statistic.GetStatisticsPath(context), @"Requests\Summary.xml");

                // Try to get the login statistics data from the cache.
                // If the data is not in the cache, try to load the file.
                // At last, if the file doesn't exist, create a new data object.
                object obj = context.Cache.Get("RequestSummaryData");
                if ((null != obj) && obj.GetType().Equals(typeof(RequestSummaryData)))
                {
                  data = (RequestSummaryData)obj;
                }
                else if (File.Exists(fileName))
                {
                  data = new RequestSummaryData();
                  data.ReadXml(fileName);
                }
                else
                {
                  data = new RequestSummaryData();
                }
              }
            }
            catch (UnauthorizedAccessException ex)
            {
              HandleNoAccessException(Statistic.GetStatisticsPath(context), ex);
            }
            catch (SecurityException ex)
            {
              HandleNoAccessException(Statistic.GetStatisticsPath(context), ex);
            }
            catch (Exception ex)
            {
              HandleException(Statistic.GetStatisticsPath(context), ex);
            }

            return data;
        }
        internal void SaveRequestSummaryData(HttpContext context, RequestSummaryData data)
        {
          if (null == context)
            throw new ArgumentNullException("context");
          if (null == data)
            throw new ArgumentNullException("data");

          lock (lockObject)
          {
            string fileName = Path.Combine(Statistic.GetStatisticsPath(context), @"Requests\Summary.xml");

            // At last, write the data back to the login statistics file and
            // put the data object back to the cache.
            try
            {
              data.WriteXml(fileName);
            }
            catch (UnauthorizedAccessException ex)
            {
              HandleNoAccessException(Statistic.GetStatisticsPath(context), ex);
            }
            catch (SecurityException ex)
            {
              HandleNoAccessException(Statistic.GetStatisticsPath(context), ex);
            }
            catch (Exception ex)
            {
              HandleException(Statistic.GetStatisticsPath(context), ex);
            }

            context.Cache.Insert("RequestSummaryData", data, null, Cache.NoAbsoluteExpiration, Cache.NoSlidingExpiration);
          }
        }