public ProductBrowser() { InitializeComponent(); Serializable.RegisterType(Product.CreateInstance); /* * Initialize Cache system properties */ Apache.Geode.Client.Properties prop = Apache.Geode.Client.Properties.Create(); prop.Insert("log-file", logFile); prop.Insert("log-level", logLevel); prop.Insert("name", "ProductCache"); CacheFactory cacheFactory = CacheFactory.CreateCacheFactory(prop); try { /* * Create the GemFire Client cache */ Cache cache = cacheFactory.SetSubscriptionEnabled(true).Create(); /* * Specify required region attributes */ RegionFactory regionFactory = cache.CreateRegionFactory(RegionShortcut.CACHING_PROXY); /* * Create the region and register interest in all keys */ prodRegion = regionFactory .SetCachingEnabled(true) .SetCacheListener(this) .Create("product"); prodRegion.RegisterAllKeys(); } catch (Exception e) { MessageBox.Show("Error during client initialization. " + e.Message); } }
public void AfterRegionDisconnected(Apache.Geode.Client.Region region) { txtEvent.Text = region.Name + " has disconnected"; }
public void Close(Apache.Geode.Client.Region region) { txtEvent.Text = region.Name + " has closed"; }