You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@geode.apache.org by rv...@apache.org on 2016/05/19 15:14:48 UTC
[41/51] [partial] incubator-geode git commit: Add source for geode
c++ and .net clients
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/ac967000/geode-client-native/examples/clicache/ProductBrowser/com/examples/gemfire/net/Product.java
----------------------------------------------------------------------
diff --git a/geode-client-native/examples/clicache/ProductBrowser/com/examples/gemfire/net/Product.java b/geode-client-native/examples/clicache/ProductBrowser/com/examples/gemfire/net/Product.java
new file mode 100755
index 0000000..20085e1
--- /dev/null
+++ b/geode-client-native/examples/clicache/ProductBrowser/com/examples/gemfire/net/Product.java
@@ -0,0 +1,201 @@
+package com.examples.gemfire.net;
+
+import java.io.DataInput;
+import java.io.DataOutput;
+import java.io.IOException;
+
+import com.gemstone.gemfire.DataSerializable;
+import com.gemstone.gemfire.Instantiator;
+
+public class Product implements DataSerializable {
+
+ private int ProductID;
+ private String Name;
+ private String ProductNumber;
+ private String MakeFlag;
+ private String FinishedGoodsFlag;
+ private String Color;
+ private int SafetyStockLevel;
+ private int ReorderPoint;
+ private double StandardCost;
+ private double ListPrice;
+ private int DaysToManufacture;
+ private String SellStartDate;
+ private String DiscontinuedDate;
+
+ static { // note that classID (7) must match C#
+ Instantiator.register(new Instantiator(Product.class, (byte) 0x07) {
+ public DataSerializable newInstance() {
+ return new Product();
+ }
+ });
+ }
+
+
+ public Product() {
+ // TODO Auto-generated constructor stub
+
+ }
+
+ public Product(int prodId, String prodName, String prodNum, String makeFlag, String finished, String color,
+ int safetyLock, int reorderPt, double stdCost, double listPrice, int mfgDays,
+ String startDate, String discDate)
+ {
+ ProductID = prodId;
+ Name = prodName;
+ ProductNumber = prodNum;
+ MakeFlag = makeFlag;
+ FinishedGoodsFlag = finished;
+ Color = color;
+ SafetyStockLevel = safetyLock;
+ ReorderPoint = reorderPt;
+ StandardCost = stdCost;
+ ListPrice = listPrice;
+ DaysToManufacture = mfgDays;
+ SellStartDate = startDate;
+ DiscontinuedDate = discDate;
+ }
+
+ public void fromData(DataInput input) throws IOException, ClassNotFoundException {
+
+ ProductID = input.readInt();
+ Name = input.readUTF();
+ ProductNumber = input.readUTF();
+ MakeFlag = input.readUTF();
+ FinishedGoodsFlag = input.readUTF();
+ Color = input.readUTF();
+ SafetyStockLevel = input.readInt();
+ ReorderPoint = input.readInt();
+ StandardCost = input.readDouble();
+ ListPrice = input.readDouble();
+ DaysToManufacture = input.readInt();
+ SellStartDate = input.readUTF();
+ DiscontinuedDate = input.readUTF();
+ }
+
+ public void toData(DataOutput output) throws IOException {
+ output.writeInt(this.getProductID());
+ output.writeUTF(this.getName());
+ output.writeUTF(this.getProductNumber());
+ output.writeUTF(this.getMakeFlag());
+ output.writeUTF(this.getFinishedGoodsFlag());
+ output.writeUTF(this.getColor());
+ output.writeInt(this.getSafetyStockLevel());
+ output.writeInt(this.getReorderPoint());
+ output.writeDouble(this.getStandardCost());
+ output.writeDouble(this.getListPrice());
+ output.writeInt(this.getDaysToManufacture());
+ output.writeUTF(this.getSellStartDate());
+ output.writeUTF(this.getDiscontinuedDate());
+ }
+
+ public String getColor() {
+ return Color;
+ }
+
+ public void setColor(String color) {
+ Color = color;
+ }
+
+ public int getDaysToManufacture() {
+ return DaysToManufacture;
+ }
+
+ public void setDaysToManufacture(int daysToManufacture) {
+ DaysToManufacture = daysToManufacture;
+ }
+
+ public String getDiscontinuedDate() {
+ return DiscontinuedDate;
+ }
+
+ public void setDiscontinuedDate(String discontinuedDate) {
+ DiscontinuedDate = discontinuedDate;
+ }
+
+ public String getFinishedGoodsFlag() {
+ return FinishedGoodsFlag;
+ }
+
+ public void setFinishedGoodsFlag(String finishedGoodsFlag) {
+ FinishedGoodsFlag = finishedGoodsFlag;
+ }
+
+ public double getListPrice() {
+ return ListPrice;
+ }
+
+ public void setListPrice(double listPrice) {
+ ListPrice = listPrice;
+ }
+
+ public String getMakeFlag() {
+ return MakeFlag;
+ }
+
+ public void setMakeFlag(String makeFlag) {
+ MakeFlag = makeFlag;
+ }
+
+ public String getName() {
+ return Name;
+ }
+
+ public void setName(String name) {
+ Name = name;
+ }
+
+ public int getProductID() {
+ return ProductID;
+ }
+
+ public void setProductID(int productID) {
+ ProductID = productID;
+ }
+
+ public String getProductNumber() {
+ return ProductNumber;
+ }
+
+ public void setProductNumber(String productNumber) {
+ ProductNumber = productNumber;
+ }
+
+ public int getReorderPoint() {
+ return ReorderPoint;
+ }
+
+ public void setReorderPoint(int reorderPoint) {
+ ReorderPoint = reorderPoint;
+ }
+
+ public int getSafetyStockLevel() {
+ return SafetyStockLevel;
+ }
+
+ public void setSafetyStockLevel(int safetyStockLevel) {
+ SafetyStockLevel = safetyStockLevel;
+ }
+
+ public String getSellStartDate() {
+ return SellStartDate;
+ }
+
+ public void setSellStartDate(String sellStartDate) {
+ SellStartDate = sellStartDate;
+ }
+
+ public double getStandardCost() {
+ return StandardCost;
+ }
+
+ public void setStandardCost(double standardCost) {
+ StandardCost = standardCost;
+ }
+
+ public Class[] getSupportedClasses() {
+ // TODO Auto-generated method stub
+ return new Class[] {com.examples.gemfire.net.Product.class};
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/ac967000/geode-client-native/examples/clicache/ProductBrowser/com/examples/gemfire/net/ProductBrowser.java
----------------------------------------------------------------------
diff --git a/geode-client-native/examples/clicache/ProductBrowser/com/examples/gemfire/net/ProductBrowser.java b/geode-client-native/examples/clicache/ProductBrowser/com/examples/gemfire/net/ProductBrowser.java
new file mode 100755
index 0000000..1bda7a7
--- /dev/null
+++ b/geode-client-native/examples/clicache/ProductBrowser/com/examples/gemfire/net/ProductBrowser.java
@@ -0,0 +1,189 @@
+package com.examples.gemfire.net;
+
+import java.io.BufferedReader;
+import java.io.File;
+import java.io.InputStreamReader;
+import java.util.Iterator;
+import java.util.Properties;
+
+import com.gemstone.gemfire.DataSerializable;
+import com.gemstone.gemfire.DataSerializer;
+import com.gemstone.gemfire.Instantiator;
+import com.gemstone.gemfire.cache.AttributesFactory;
+import com.gemstone.gemfire.cache.Cache;
+import com.gemstone.gemfire.cache.CacheException;
+import com.gemstone.gemfire.cache.CacheFactory;
+import com.gemstone.gemfire.cache.Region;
+import com.gemstone.gemfire.cache.Scope;
+import com.gemstone.gemfire.cache.util.BridgeLoader;
+import com.gemstone.gemfire.cache.util.BridgeWriter;
+import com.gemstone.gemfire.distributed.DistributedSystem;
+
+
+public class ProductBrowser {
+
+ /**
+ * @param args
+ */
+ /** This example's connection to the distributed system */
+ private DistributedSystem system = null;
+
+ /** Cache <code>Region</code> currently reviewed by this example */
+ private Region productRegion;
+
+ /** The cache used in the example */
+ private Cache cache;
+
+ private File xmlFile = new File("product.xml");
+
+
+ public static void main(String[] args) {
+ // TODO Auto-generated method stub
+
+ ProductBrowser client = new ProductBrowser();
+ try {
+ client.initialize();
+ client.go();
+ }
+ catch (CacheException ce)
+ {
+ ce.printStackTrace();
+ }
+ catch (Exception e)
+ {
+ System.out.println("\nException...");
+ e.printStackTrace();
+ }
+
+ }
+
+ /*
+ * Initialized the cache client. Gemfire.properties and product.xml are required
+ * for initialization. No additional cache or region parameters are specified
+ * programmatically
+ */
+ private void initialize() throws CacheException, Exception {
+ Properties props = new Properties();
+ props.setProperty("cache-xml-file", this.xmlFile.toString());
+ system = DistributedSystem.connect(props);
+ cache = CacheFactory.create(system);
+
+ productRegion = cache.getRegion("product");
+
+ // register the product class for heterogeneous client access.
+ Instantiator.register(new Instantiator(Product.class, (byte) 0x07) {
+ public DataSerializable newInstance() {
+ return new Product();
+ }
+ });
+
+ }
+
+ /*
+ * Allows the user to search and create entries in the cache.
+ */
+ private void go() throws CacheException, Exception
+ {
+ String command;
+ String key;
+ BufferedReader bin = new BufferedReader(new InputStreamReader(System.in));
+
+ do {
+ System.out.print("\n\n");
+ System.out.print("Enter the operation to execute. 'Get' to find an object, 'Put' to insert/update an object, or 'Exit' to end: ");
+
+ command = bin.readLine();
+
+ if (command.equalsIgnoreCase("get"))
+ {
+ System.out.print("Enter the Product ID to search for: ");
+ key = bin.readLine();
+ Product prod = (Product)productRegion.get(key);
+
+ if (prod != null) {
+ System.out.println("Product ID = " + prod.getProductID());
+ System.out.println("Product Name = " + prod.getName());
+ System.out.println("Product Number = " + prod.getProductNumber());
+ System.out.println("Color = " + prod.getColor());
+ System.out.println("Stock Level = " + prod.getSafetyStockLevel());
+ System.out.println("Reorder Point = " + prod.getReorderPoint());
+ System.out.println("Product Cost = " + prod.getStandardCost());
+ System.out.println("List Price = " + prod.getListPrice());
+ System.out.println("Available as of = " + prod.getSellStartDate());
+ System.out.println("Discontinue as of = " + prod.getDiscontinuedDate());
+ }
+ else {
+ System.out.println("Product not found in the cache.");
+ }
+ }
+ else if (command.equalsIgnoreCase("put"))
+ {
+ System.out.print("ProductId: ");
+ String pId = bin.readLine();
+ Integer pKey = new Integer(pId);
+
+ System.out.print("Product Name: ");
+ String pName = bin.readLine();
+
+ System.out.print("Product Number: ");
+ String pNum = bin.readLine();
+
+ System.out.print("Color: ");
+ String color = bin.readLine();
+
+ System.out.print("Stock Level (int): ");
+ String stockLevel = bin.readLine();
+
+ System.out.print("Reorder Point (int): ");
+ String reorderPoint = bin.readLine();
+
+ System.out.print("Product Cost (double): ");
+ String cost = bin.readLine();
+
+ System.out.print("List Price (double): ");
+ String listPrice = bin.readLine();
+
+ System.out.print("Available as of (string): ");
+ String availableAsOf = bin.readLine();
+
+ System.out.print("Discontinue as of (string): ");
+ String discAsOf = bin.readLine();
+
+ try {
+ // Populate the product object with the values specified and insert into the
+ // cache. Please note that no type checking is performed. Entering an
+ // invalid type will result in an exception
+ Product prod = new Product();
+ prod.setProductID(pKey.intValue());
+ prod.setName(pName);
+ prod.setProductNumber(pNum);
+ prod.setMakeFlag("false");
+ prod.setFinishedGoodsFlag("false");
+ prod.setColor(color);
+ prod.setSafetyStockLevel(new Integer(stockLevel).intValue());
+ prod.setReorderPoint(new Integer(reorderPoint).intValue());
+ prod.setStandardCost(new Double(cost).doubleValue());
+ prod.setListPrice(new Double(listPrice).doubleValue());
+ prod.setDaysToManufacture(2);
+ prod.setSellStartDate(availableAsOf);
+ prod.setDiscontinuedDate(discAsOf);
+
+ productRegion.put(pId, prod);
+ }
+ catch (NumberFormatException nfe)
+ {
+ System.out.println("\n\nException occurred populating the Product Object. ");
+ System.out.println("------> Stock level, reorder point, list price and product cost must be numeric values");
+ }
+ catch (Exception re)
+ {
+ System.out.println("Eception occurred adding the object to the cache. Exception is:");
+ re.printStackTrace();
+ }
+
+ }
+ } while (!command.equalsIgnoreCase("exit"));
+ }
+
+
+}
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/ac967000/geode-client-native/examples/clicache/ProductBrowser/defaultConfig/gemfire.properties
----------------------------------------------------------------------
diff --git a/geode-client-native/examples/clicache/ProductBrowser/defaultConfig/gemfire.properties b/geode-client-native/examples/clicache/ProductBrowser/defaultConfig/gemfire.properties
new file mode 100644
index 0000000..b5b659c
--- /dev/null
+++ b/geode-client-native/examples/clicache/ProductBrowser/defaultConfig/gemfire.properties
@@ -0,0 +1,7 @@
+#Fri Dec 15 10:20:26 PST 2006
+cache-xml-file=product.xml
+mcast-port=10334
+mcast-address=239.192.81.1
+log-level=config
+log-file=productBrowserServer.log
+name=ProductBrowserServer
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/ac967000/geode-client-native/examples/clicache/ProductBrowser/defaultConfig/product.xml
----------------------------------------------------------------------
diff --git a/geode-client-native/examples/clicache/ProductBrowser/defaultConfig/product.xml b/geode-client-native/examples/clicache/ProductBrowser/defaultConfig/product.xml
new file mode 100644
index 0000000..8f92be6
--- /dev/null
+++ b/geode-client-native/examples/clicache/ProductBrowser/defaultConfig/product.xml
@@ -0,0 +1,8 @@
+<?xml version="1.0"?>
+<!DOCTYPE cache PUBLIC "-//GemStone Systems, Inc.//GemFire Declarative Caching 5.0//EN" "http://www.gemstone.com/dtd/cache6_0.dtd">
+<cache lock-lease="120" lock-timeout="60" search-timeout="300" is-server="true" copy-on-read="false">
+ <bridge-server port="40404" notify-by-subscription="true"/>
+ <region name="product">
+ <region-attributes/>
+ </region>
+</cache>
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/ac967000/geode-client-native/examples/clicache/ProductBrowser/gemfire.properties
----------------------------------------------------------------------
diff --git a/geode-client-native/examples/clicache/ProductBrowser/gemfire.properties b/geode-client-native/examples/clicache/ProductBrowser/gemfire.properties
new file mode 100755
index 0000000..b5b659c
--- /dev/null
+++ b/geode-client-native/examples/clicache/ProductBrowser/gemfire.properties
@@ -0,0 +1,7 @@
+#Fri Dec 15 10:20:26 PST 2006
+cache-xml-file=product.xml
+mcast-port=10334
+mcast-address=239.192.81.1
+log-level=config
+log-file=productBrowserServer.log
+name=ProductBrowserServer
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/ac967000/geode-client-native/examples/clicache/ProductBrowser/product.xml
----------------------------------------------------------------------
diff --git a/geode-client-native/examples/clicache/ProductBrowser/product.xml b/geode-client-native/examples/clicache/ProductBrowser/product.xml
new file mode 100755
index 0000000..3e87daf
--- /dev/null
+++ b/geode-client-native/examples/clicache/ProductBrowser/product.xml
@@ -0,0 +1,13 @@
+<?xml version="1.0"?>
+
+<!DOCTYPE cache PUBLIC
+ "-//GemStone Systems, Inc.//GemFire Declarative Caching 5.0//EN"
+ "http://www.gemstone.com/dtd/cache6_0.dtd">
+
+<cache lock-lease="120" lock-timeout="60" search-timeout="300" is-server="true" copy-on-read="false">
+ <bridge-server port="40404" notify-by-subscription="true"/>
+ <region name="product">
+ <region-attributes scope="distributed-no-ack" data-policy="normal">
+ </region-attributes>
+ </region>
+</cache>
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/ac967000/geode-client-native/examples/clicache/UserObjects/AccountHistory.cs
----------------------------------------------------------------------
diff --git a/geode-client-native/examples/clicache/UserObjects/AccountHistory.cs b/geode-client-native/examples/clicache/UserObjects/AccountHistory.cs
new file mode 100644
index 0000000..a16b901
--- /dev/null
+++ b/geode-client-native/examples/clicache/UserObjects/AccountHistory.cs
@@ -0,0 +1,94 @@
+/*=========================================================================
+ * Copyright (c) 2002-2014 Pivotal Software, Inc. All Rights Reserved.
+ * This product is protected by U.S. and international copyright
+ * and intellectual property laws. Pivotal products are covered by
+ * more patents listed at http://www.pivotal.io/patents.
+ *========================================================================
+ */
+
+using System;
+using System.Collections.Generic;
+
+namespace GemStone.GemFire.Cache.Examples
+{
+ class AccountHistory : IGFSerializable
+ {
+ #region Private members
+
+ private List<string> m_history;
+
+ #endregion
+
+ public AccountHistory()
+ {
+ m_history = new List<string>();
+ }
+
+ public void ShowAccountHistory()
+ {
+ Console.WriteLine("AccountHistory:");
+ foreach (string hist in m_history)
+ {
+ Console.WriteLine("\t{0}", hist);
+ }
+ }
+
+ public void AddLog(string entry)
+ {
+ m_history.Add(entry);
+ }
+
+ public static IGFSerializable CreateInstance()
+ {
+ return new AccountHistory();
+ }
+
+ #region IGFSerializable Members
+
+ public IGFSerializable FromData(DataInput input)
+ {
+ int len = input.ReadInt32();
+
+ m_history.Clear();
+ for (int i = 0; i < len; i++)
+ {
+ m_history.Add(input.ReadUTF());
+ }
+ return this;
+ }
+
+ public void ToData(DataOutput output)
+ {
+ output.WriteInt32(m_history.Count);
+ foreach (string hist in m_history)
+ {
+ output.WriteUTF(hist);
+ }
+ }
+
+ public UInt32 ClassId
+ {
+ get
+ {
+ return 0x05;
+ }
+ }
+
+ public UInt32 ObjectSize
+ {
+ get
+ {
+ UInt32 objectSize = 0;
+ foreach (string hist in m_history)
+ {
+ objectSize += (UInt32)(hist == null ? 0 : sizeof(char) * hist.Length);
+ }
+ return objectSize;
+
+ }
+
+ }
+
+ #endregion
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/ac967000/geode-client-native/examples/clicache/UserObjects/BankAccount.cs
----------------------------------------------------------------------
diff --git a/geode-client-native/examples/clicache/UserObjects/BankAccount.cs b/geode-client-native/examples/clicache/UserObjects/BankAccount.cs
new file mode 100644
index 0000000..3f997e7
--- /dev/null
+++ b/geode-client-native/examples/clicache/UserObjects/BankAccount.cs
@@ -0,0 +1,130 @@
+/*=========================================================================
+ * Copyright (c) 2002-2014 Pivotal Software, Inc. All Rights Reserved.
+ * This product is protected by U.S. and international copyright
+ * and intellectual property laws. Pivotal products are covered by
+ * more patents listed at http://www.pivotal.io/patents.
+ *========================================================================
+ */
+
+using System;
+
+namespace GemStone.GemFire.Cache.Examples
+{
+ class BankAccount : ICacheableKey
+ {
+ #region Private members
+
+ private int m_customerId;
+ private int m_accountId;
+
+ #endregion
+
+ #region Public accessors
+
+ public int Customer
+ {
+ get
+ {
+ return m_customerId;
+ }
+ }
+
+ public int Account
+ {
+ get
+ {
+ return m_accountId;
+ }
+ }
+
+ #endregion
+
+ public BankAccount(int customer, int account)
+ {
+ m_customerId = customer;
+ m_accountId = account;
+ }
+
+ // Our TypeFactoryMethod
+ public static IGFSerializable CreateInstance()
+ {
+ return new BankAccount(0, 0);
+ }
+
+ #region IGFSerializable Members
+
+ public void ToData(DataOutput output)
+ {
+ output.WriteInt32(m_customerId);
+ output.WriteInt32(m_accountId);
+ }
+
+ public IGFSerializable FromData(DataInput input)
+ {
+ m_customerId = input.ReadInt32();
+ m_accountId = input.ReadInt32();
+ return this;
+ }
+
+ public UInt32 ClassId
+ {
+ get
+ {
+ return 0x04;
+ }
+ }
+
+ public UInt32 ObjectSize
+ {
+ get
+ {
+ return (UInt32)(sizeof(Int32) + sizeof(Int32));
+ }
+
+ }
+
+ #endregion
+
+ #region ICacheableKey Members
+
+ public bool Equals(ICacheableKey other)
+ {
+ BankAccount otherAccount = other as BankAccount;
+ if (otherAccount != null)
+ {
+ return (m_customerId == otherAccount.m_customerId) &&
+ (m_accountId == otherAccount.m_accountId);
+ }
+ return false;
+ }
+
+ public override int GetHashCode()
+ {
+ return (m_customerId ^ m_accountId);
+ }
+
+ #endregion
+
+ #region Overriden System.Object methods
+
+ public override bool Equals(object obj)
+ {
+ BankAccount otherAccount = obj as BankAccount;
+ if (otherAccount != null)
+ {
+ return (m_customerId == otherAccount.m_customerId) &&
+ (m_accountId == otherAccount.m_accountId);
+ }
+ return false;
+ }
+
+ // Also override ToString to get a nice string representation.
+ public override string ToString()
+ {
+ return string.Format("BankAccount( customer: {0}, account: {1} )",
+ m_customerId, m_accountId);
+ }
+
+ #endregion
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/ac967000/geode-client-native/examples/clicache/UserObjects/Program.cs
----------------------------------------------------------------------
diff --git a/geode-client-native/examples/clicache/UserObjects/Program.cs b/geode-client-native/examples/clicache/UserObjects/Program.cs
new file mode 100644
index 0000000..3dd9111
--- /dev/null
+++ b/geode-client-native/examples/clicache/UserObjects/Program.cs
@@ -0,0 +1,73 @@
+/*=========================================================================
+ * Copyright (c) 2002-2014 Pivotal Software, Inc. All Rights Reserved.
+ * This product is protected by U.S. and international copyright
+ * and intellectual property laws. Pivotal products are covered by
+ * more patents listed at http://www.pivotal.io/patents.
+ *========================================================================
+ */
+
+using System;
+
+namespace GemStone.GemFire.Cache.Examples
+{
+ class UserObjects
+ {
+ static void Main()
+ {
+ // Register the user-defined serializable type.
+ Serializable.RegisterType(AccountHistory.CreateInstance);
+ Serializable.RegisterType(BankAccount.CreateInstance);
+
+ // Create a GemFire Cache Programmatically.
+ CacheFactory cacheFactory = CacheFactory.CreateCacheFactory(null);
+ Cache cache = cacheFactory.SetSubscriptionEnabled(true).Create();
+
+ Console.WriteLine("Created the GemFire Cache");
+
+ RegionFactory regionFactory = cache.CreateRegionFactory(RegionShortcut.LOCAL);
+ Console.WriteLine("Created Region Factory");
+
+ // Create the example Region programmatically.
+ Region region = regionFactory
+ .Create("BankAccounts");
+
+ Console.WriteLine("Created the Region Programmatically.");
+
+ // Place some instances of BankAccount cache region.
+ BankAccount baKey = new BankAccount(2309, 123091);
+ AccountHistory ahVal = new AccountHistory();
+ ahVal.AddLog("Created account");
+ region.Put(baKey, ahVal);
+ Console.WriteLine("Put an AccountHistory in cache keyed with BankAccount.");
+
+ // Display the BankAccount information.
+ Console.WriteLine(baKey.ToString());
+
+ // Call custom behavior on instance of AccountHistory.
+ ahVal.ShowAccountHistory();
+
+ // Get a value out of the region.
+ AccountHistory history = region.Get(baKey) as AccountHistory;
+ if (history != null)
+ {
+ Console.WriteLine("Found AccountHistory in the cache.");
+ history.ShowAccountHistory();
+ history.AddLog("debit $1,000,000.");
+ region.Put(baKey, history);
+ Console.WriteLine("Updated AccountHistory in the cache.");
+ }
+
+ // Look up the history again.
+ history = region.Get(baKey) as AccountHistory;
+ if (history != null)
+ {
+ Console.WriteLine("Found AccountHistory in the cache.");
+ history.ShowAccountHistory();
+ }
+
+ // Close the cache.
+ cache.Close();
+
+ }
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/ac967000/geode-client-native/examples/clicache/UserObjects/Properties/AssemblyInfo.cs
----------------------------------------------------------------------
diff --git a/geode-client-native/examples/clicache/UserObjects/Properties/AssemblyInfo.cs b/geode-client-native/examples/clicache/UserObjects/Properties/AssemblyInfo.cs
new file mode 100644
index 0000000..52d496b
--- /dev/null
+++ b/geode-client-native/examples/clicache/UserObjects/Properties/AssemblyInfo.cs
@@ -0,0 +1,33 @@
+\ufeffusing System.Reflection;
+using System.Runtime.CompilerServices;
+using System.Runtime.InteropServices;
+
+// General Information about an assembly is controlled through the following
+// set of attributes. Change these attribute values to modify the information
+// associated with an assembly.
+[assembly: AssemblyTitle("GemFireUserObjects")]
+[assembly: AssemblyDescription("GemFire Simple Bank Example")]
+[assembly: AssemblyConfiguration("")]
+[assembly: AssemblyCompany("GemStone Systems Inc.")]
+[assembly: AssemblyProduct("GemFireUserObjects")]
+[assembly: AssemblyCopyright("Copyright � GemStone Systems Inc. 2008")]
+[assembly: AssemblyTrademark("All Rights Reserved")]
+[assembly: AssemblyCulture("")]
+
+// Setting ComVisible to false makes the types in this assembly not visible
+// to COM components. If you need to access a type in this assembly from
+// COM, set the ComVisible attribute to true on that type.
+[assembly: ComVisible(false)]
+
+// The following GUID is for the ID of the typelib if this project is exposed to COM
+[assembly: Guid("446a6d15-e898-4fd5-8493-2076da55bd84")]
+
+// Version information for an assembly consists of the following four values:
+//
+// Major Version
+// Minor Version
+// Build Number
+// Revision
+//
+[assembly: AssemblyVersion("9.0.0.0")]
+[assembly: AssemblyFileVersion("9.0.0.0")]
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/ac967000/geode-client-native/examples/clicache/UserObjects/UserObjects.csproj
----------------------------------------------------------------------
diff --git a/geode-client-native/examples/clicache/UserObjects/UserObjects.csproj b/geode-client-native/examples/clicache/UserObjects/UserObjects.csproj
new file mode 100644
index 0000000..b88d985
--- /dev/null
+++ b/geode-client-native/examples/clicache/UserObjects/UserObjects.csproj
@@ -0,0 +1,87 @@
+\ufeff<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="3.5">
+ <PropertyGroup>
+ <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+ <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+ <ProductVersion>8.0.50727</ProductVersion>
+ <SchemaVersion>2.0</SchemaVersion>
+ <ProjectGuid>{9FF38F43-864D-45EB-AD38-2AC2AD272C9E}</ProjectGuid>
+ <OutputType>Exe</OutputType>
+ <AppDesignerFolder>Properties</AppDesignerFolder>
+ <RootNamespace>GemStone.GemFire.Cache.Examples</RootNamespace>
+ <AssemblyName>UserObjects</AssemblyName>
+ <FileUpgradeFlags>
+ </FileUpgradeFlags>
+ <OldToolsVersion>2.0</OldToolsVersion>
+ <UpgradeBackupLocation>
+ </UpgradeBackupLocation>
+ </PropertyGroup>
+ <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+ <DebugSymbols>true</DebugSymbols>
+ <DebugType>full</DebugType>
+ <Optimize>false</Optimize>
+ <IntermediateOutputPath>$(OSBUILDDIR)\examples\clicache\Debug\UserObjects\</IntermediateOutputPath>
+ <OutputPath>$(OSBUILDDIR)\examples\clicache\Debug\UserObjects\</OutputPath>
+ <DefineConstants>DEBUG;TRACE</DefineConstants>
+ <ErrorReport>prompt</ErrorReport>
+ <WarningLevel>4</WarningLevel>
+ <PlatformTarget>x86</PlatformTarget>
+ <NoWarn>618</NoWarn>
+ </PropertyGroup>
+ <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+ <DebugType>pdbonly</DebugType>
+ <Optimize>true</Optimize>
+ <IntermediateOutputPath>$(OSBUILDDIR)\examples\clicache\UserObjects\</IntermediateOutputPath>
+ <OutputPath>$(OSBUILDDIR)\examples\clicache\UserObjects\</OutputPath>
+ <DefineConstants>TRACE</DefineConstants>
+ <ErrorReport>prompt</ErrorReport>
+ <WarningLevel>4</WarningLevel>
+ <PlatformTarget>x86</PlatformTarget>
+ <NoWarn>618</NoWarn>
+ </PropertyGroup>
+ <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x64' ">
+ <DebugSymbols>true</DebugSymbols>
+ <IntermediateOutputPath>$(OSBUILDDIR)\examples\clicache\Debug\UserObjects\</IntermediateOutputPath>
+ <OutputPath>$(OSBUILDDIR)\examples\clicache\Debug\UserObjects\</OutputPath>
+ <DefineConstants>DEBUG;TRACE</DefineConstants>
+ <DebugType>full</DebugType>
+ <Optimize>false</Optimize>
+ <PlatformTarget>x64</PlatformTarget>
+ <ErrorReport>prompt</ErrorReport>
+ <WarningLevel>4</WarningLevel>
+ <NoWarn>618</NoWarn>
+ </PropertyGroup>
+ <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x64' ">
+ <IntermediateOutputPath>$(OSBUILDDIR)\examples\clicache\UserObjects\</IntermediateOutputPath>
+ <OutputPath>$(OSBUILDDIR)\examples\clicache\UserObjects\</OutputPath>
+ <DefineConstants>TRACE</DefineConstants>
+ <Optimize>true</Optimize>
+ <DebugType>pdbonly</DebugType>
+ <PlatformTarget>x64</PlatformTarget>
+ <ErrorReport>prompt</ErrorReport>
+ <WarningLevel>4</WarningLevel>
+ <NoWarn>618</NoWarn>
+ </PropertyGroup>
+ <ItemGroup>
+ <Reference Include="System" />
+ </ItemGroup>
+ <ItemGroup>
+ <Compile Include="AccountHistory.cs" />
+ <Compile Include="BankAccount.cs" />
+ <Compile Include="Program.cs" />
+ <Compile Include="Properties\AssemblyInfo.cs" />
+ </ItemGroup>
+ <ItemGroup>
+ <ProjectReference Include="..\..\..\vs_projects\gfclicache\gfclicache.vcproj">
+ <Project>{B274E3B1-6A09-4322-952B-8BDA712892CE}</Project>
+ <Name>gfclicache</Name>
+ </ProjectReference>
+ </ItemGroup>
+ <Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
+ <!-- To modify your build process, add your task inside one of the targets below and uncomment it.
+ Other similar extension points exist, see Microsoft.Common.targets.
+ <Target Name="BeforeBuild">
+ </Target>
+ <Target Name="AfterBuild">
+ </Target>
+ -->
+</Project>
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/ac967000/geode-client-native/examples/dist/c-overview.dox
----------------------------------------------------------------------
diff --git a/geode-client-native/examples/dist/c-overview.dox b/geode-client-native/examples/dist/c-overview.dox
new file mode 100644
index 0000000..3cf17d9
--- /dev/null
+++ b/geode-client-native/examples/dist/c-overview.dox
@@ -0,0 +1,16 @@
+// This file contains external summary documentation for the GemFire C
+// API similar to an "overview.html" in Javadoc. The document tags it
+// uses can be interpreted by DOxygen.
+
+/**
+ * @mainpage Examples of the GemFire Distributed C API
+ *
+ * The following programs provide examples of using the GemFire C API
+ * to access distributed cached data.
+ *
+ * \li cacheRunner.c is an interactive program that allows you to
+ * explore the C API to the GemFire distributed cache
+ *
+ * \li ha.c allows you to experiment with GemFire's high availability
+ * and failover features
+ */