protected void Application_BeginRequest(object sender, EventArgs e)
        {
            cache = Models.Cache.Initalize();

            if (cache == null)
            {
                throw new ArgumentNullException("cache");
            }

            region = Models.Region.Initalize("memberRegion", cache);

            if (region == null)
            {
                throw new ArgumentNullException("region");
            }
        }
        public static Apache.Geode.Client.Cache Initalize()
        {
            if (!File.Exists(baseDir + @"\cache.xml"))
            {
                throw new FileNotFoundException();
            }

            Apache.Geode.Client.Properties <string, string> cacheProps = new Apache.Geode.Client.Properties <string, string>();
            cacheProps.Insert("cache-xml-file", baseDir + @"\cache.xml");
            cacheProps.Insert("log-level", "fine");
            cacheProps.Insert("log-file", @"c:\Logs\client.log");
            cacheProps.Insert("ssl-enabled", "true");
            cacheProps.Insert("ssl-truststore", baseDir + @"\certificatetruststore");

            Apache.Geode.Client.CacheFactory cacheFactory = Apache.Geode.Client.CacheFactory.CreateCacheFactory(cacheProps);

            Apache.Geode.Client.Cache cache = cacheFactory.Create();

            return(cache);
        }
        public static Apache.Geode.Client.IRegion <string, string> Initalize(string name, Apache.Geode.Client.Cache cache)
        {
            if (string.IsNullOrEmpty(name) || cache == null)
            {
                throw new ArgumentNullException();
            }

            Apache.Geode.Client.RegionFactory            regionFactory = cache.CreateRegionFactory(Apache.Geode.Client.RegionShortcut.PROXY);
            Apache.Geode.Client.IRegion <string, string> region        = regionFactory.Create <string, string>(name);

            return(region);
        }