http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/ac967000/geode-client-native/examples/clicache/ExecuteFunctions/Properties/AssemblyInfo.cs ---------------------------------------------------------------------- diff --git a/geode-client-native/examples/clicache/ExecuteFunctions/Properties/AssemblyInfo.cs b/geode-client-native/examples/clicache/ExecuteFunctions/Properties/AssemblyInfo.cs new file mode 100644 index 0000000..ff516af --- /dev/null +++ b/geode-client-native/examples/clicache/ExecuteFunctions/Properties/AssemblyInfo.cs @@ -0,0 +1,33 @@ +using 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("GemFireExecuteFunctions")] +[assembly: AssemblyDescription("GemFire Simple Bank Example")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("GemStone Systems Inc.")] +[assembly: AssemblyProduct("GemFireExecuteFunctions")] +[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-2076da55bd85")] + +// 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/ExecuteFunctions/README.html ---------------------------------------------------------------------- diff --git a/geode-client-native/examples/clicache/ExecuteFunctions/README.html b/geode-client-native/examples/clicache/ExecuteFunctions/README.html new file mode 100755 index 0000000..772fdf4 --- /dev/null +++ b/geode-client-native/examples/clicache/ExecuteFunctions/README.html @@ -0,0 +1,427 @@ + + + + + + + + +ExecuteFunctions: Pivotal GemFire® Native Client Example + + + + + + + + + +
+ +
+ +

ExecuteFunctions

+ +

GemFire Native Client

+ +

C# Programming Example

+ +
+ + +
+ +

About the ExecuteFunctions Example

+ +

The ExecuteFunctions +example is a C# program that uses Microsoft .NET Framework 4.0 to access the +GemFire C++ API for continuous query.

+ +
+ +

Microsoft .NET Framework 4.0 must be installed before running this +example. For information about installing the .NET Framework, see the GemFire +Native Client User's Guide.

+ +
+ +

The client application comes with a cache configuration file, clientExecuteFunctions.xml, which is configured to +create a root region and establish the native client endpoints to the +locally-run server by specifying localhost:50505. If java server is +located on another host, change localhost to that +host accordingly.

+ +

The ExecuteFunctions +cache listens for client requests at a specific port (see serverExecuteFunctions.xml). The client connects +to the cache server's port.

+ +
+ +
+ +

Configuring the Environment

+ +

Examples that interact with a Java cache server require specific environment +configurations so the Java cache server will run properly. Follow the +configuration steps listed below that apply to your operating system:

+ +
+ +
+ +
    +
  1. From the GemFire + product installation directory, configure your environment settings by + following the steps in examples/EnvSetup.html. + Refer to the developer's guide if you need help with this step.
  2. +
  3. Set the JAVA_HOME and GF_JAVA_HOME environment variables + to your installed Java JRE or JDK. See the Installation chapter of the GemFire + User's Guide for the versions of Java that + are compatible with GemFire. The JAVA_HOME setting is for your applications, and GF_JAVA_HOME is for the GemFire + scripts. You must have a compatible Java JRE or JDK installed and you must + set JAVA_HOME and GF_JAVA_HOME to point to it.
  4. +
  5. Add $JAVA_HOME/bin to the start of your + PATH.
  6. +
  7. Add the GemFire quickstart classes to your CLASSPATH.
  8. +
+ +

set CLASSPATH=%GEMFIRE%\quickstart\classes;%CLASSPATH%

+ +

The following is a list of the environment configuration commands for the ExecuteFunctions +example. Choose the set of commands that are appropriate for your operating +system. The text that you type is shown in bold. These configurations only need +to be performed for the sessions that invoke the Java cache server.

+ +

Bourne and Korn shells (sh, ksh, bash)

+ +
+ +

% cd GemFireInstallDirectory
+% CLASSPATH=$CLASSPATH:$GEMFIRE/quickstart/classes; +export CLASSPATH
+% cd $GEMFIRE/quickstart
+% JAVA_HOME=<Installed +JRE PATH>; export JAVA_HOME
+% GF_JAVA_HOME=$JAVA_HOME; +export GF_JAVA_HOME
+% PATH=$JAVA_HOME/bin:$PATH; export PATH

+ +
+ +

Windows

+ +
+ +

> cd GemFireInstallDirectory
+> set +CLASSPATH=%GEMFIRE%\quickstart\classes;%CLASSPATH%
+> cd %GEMFIRE%\quickstart
+> set +JAVA_HOME=<Installed JRE PATH>
+> set +GF_JAVA_HOME=%JAVA_HOME%
+> set +PATH=%JAVA_HOME%\bin;%PATH%

+ +
+ +
+ +
+ +

Starting ExecuteFunctions

+ +

To run the ExecuteFunctions +example, create a session from the GemFire product directory and +complete the following steps. Throughout this example, when you're prompted to +enter the native client directory, replace the xxxx in NativeClient_xxxx with the actual +four-digit product version number. Note that in the following steps, except ExecuteFunctions.exe, +all other programs can be run on other operating system machines.

+ +

This first session starts the Java cache server.

+ +
+ +

cd examples\ExecuteFunctions

+ + +
    +
  1. Start Java server:
  2. +
+ +

startServer.bat

+ +
    +
  1. Create another session and go + to the cli_ExecuteFunctions + example directory:
  2. +
+ +

cd examples\cli_ExecuteFunctions

+ +
    +
  1. Start the ExecuteFunctions application:
  2. +
+ +
+ +

ExecuteFunctions.exe

+ +
+ +
    +
  1. Start the updater application. In another window:
  2. +
+
+

cd examples\ExecuteFunctions

+ +

�� +runUpdater.bat <itr +number>, where itr number is the number of +iterations you want this program to run, e.g, 500.

+ +
    +
  1. Stop Java server. In the window where java server was started:
  2. +
+
+

stopServer.bat

+
+
+ +

Top

+ +


+

Copyright © 2006-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 one or more patents listed at +http://www.pivotal.io/patents.

+ + + + + + http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/ac967000/geode-client-native/examples/clicache/HelloWorld/DocIndex.css ---------------------------------------------------------------------- diff --git a/geode-client-native/examples/clicache/HelloWorld/DocIndex.css b/geode-client-native/examples/clicache/HelloWorld/DocIndex.css new file mode 100644 index 0000000..4c7ce28 --- /dev/null +++ b/geode-client-native/examples/clicache/HelloWorld/DocIndex.css @@ -0,0 +1,1058 @@ +A.link { + color: blue; + text-decoration: underline; +} +A.visited { + color: purple; + text-decoration: underline; +} +A.active { + color: red; + text-decoration: underline; +} +LI.Appendix { + display: block; + text-align: left; + text-indent: -90.000000pt; + margin-top: 0.000000pt; + margin-bottom: 200.000000pt; + margin-right: 0.000000pt; + margin-left: 90.000000pt; + font-size: 36.000000pt; + font-weight: medium; + font-style: Italic; + color: #000000; + text-decoration: none; + vertical-align: baseline; + text-transform: none; + font-family: "Arial"; +} +P.Body { + display: block; + text-align: left; + text-indent: 0pt; + margin-top: 5pt; + margin-bottom: 5pt; + margin-right: 0pt; + margin-left: 0pt; + font-size: 10pt; + font-weight: medium; + font-style: Regular; + color: #000000; + text-decoration: none; + vertical-align: baseline; + text-transform: none; + font-family: "Arial"; +} +P.Body8 { + display: block; + text-align: left; + text-indent: 0.000000pt; + margin-top: 1.000000pt; + margin-bottom: 5.000000pt; + margin-right: 0.000000pt; + margin-left: 0.000000pt; + font-size: 8.000000pt; + font-weight: medium; + font-style: Regular; + color: #000000; + text-decoration: none; + vertical-align: baseline; + text-transform: none; + font-family: "Arial"; +} +P.Body9 { + display: block; + text-align: left; + text-indent: 0.000000pt; + margin-top: 5.000000pt; + margin-bottom: 5.000000pt; + margin-right: 0.000000pt; + margin-left: 0.000000pt; + font-size: 9.000000pt; + font-weight: medium; + font-style: Regular; + color: #000000; + text-decoration: none; + vertical-align: baseline; + text-transform: none; + font-family: "Arial"; +} +LI.Body { + display: block; + text-align: left; + text-indent: 0pt; + margin-top: 5pt; + margin-bottom: 5pt; + margin-right: 0pt; + margin-left: 0pt; + font-size: 10pt; + font-weight: medium; + font-style: Regular; + color: #000000; + text-decoration: none; + vertical-align: baseline; + text-transform: none; + font-family: "Arial"; +} +LI.Bulleted { + display: block; + text-align: left; + text-indent: 0pt; + margin-top: 6pt; + margin-bottom: 6pt; + margin-right: 0pt; + margin-left: 18pt; + font-size: 10pt; + font-weight: medium; + font-style: Regular; + color: #000000; + text-decoration: none; + vertical-align: baseline; + text-transform: none; + font-family: "Arial"; +} +LI.Bulleted-Indented { + display: block; + text-align: left; + text-indent: 0pt; + margin-top: 4pt; + margin-bottom: 4pt; + margin-right: 0pt; + margin-left: 36pt; + font-size: 10pt; + font-weight: medium; + font-style: Regular; + color: #000000; + text-decoration: none; + vertical-align: baseline; + text-transform: none; + font-family: "Arial"; +} +P.CellBody { + display: block; + text-align: left; + text-indent: 0.000000pt; + margin-top: 0.000000pt; + margin-bottom: 1.000000pt; + margin-right: 0.000000pt; + margin-left: 0.000000pt; + font-size: 10.000000pt; + font-weight: medium; + font-style: regular; + color: #000000; + text-decoration: none; + vertical-align: baseline; + text-transform: none; + font-family: "Arial"; +} +P.CellHeading { + display: block; + text-align: left; + text-indent: 0.000000pt; + margin-top: 0.000000pt; + margin-bottom: 0.000000pt; + margin-right: 0.000000pt; + margin-left: 0.000000pt; + font-size: 10.000000pt; + font-weight: Bold; + font-style: Regular; + color: #000000; + text-decoration: none; + vertical-align: baseline; + text-transform: none; + font-family: "Arial"; +} +H1.Chapter, H2.Chapter, H3.Chapter, H4.Chapter, H5.Chapter, H6.Chapter { + display: block; + text-align: left; + text-indent: -90.000000pt; + margin-top: 0.000000pt; + margin-bottom: 200.000000pt; + margin-right: 0.000000pt; + margin-left: 90.000000pt; + font-size: 36.000000pt; + font-weight: medium; + font-style: Italic; + color: #000000; + text-decoration: none; + vertical-align: baseline; + text-transform: none; + font-family: "Times New Roman"; +} +LI.ChapterEA { + display: block; + text-align: left; + text-indent: -90.000000pt; + margin-top: 0.000000pt; + margin-bottom: 20.000000pt; + margin-right: 0.000000pt; + margin-left: 90.000000pt; + font-size: 36.000000pt; + font-weight: medium; + font-style: Italic; + color: #000000; + text-decoration: none; + vertical-align: baseline; + text-transform: none; + font-family: "Times New Roman"; +} +P.ChapterEA2 { + display: block; + text-align: left; + text-indent: 0.000000pt; + margin-top: 7.000000pt; + margin-bottom: 7.000000pt; + margin-right: 0.000000pt; + margin-left: 0.000000pt; + font-size: 14.000000pt; + font-weight: medium; + font-style: Regular; + color: #000000; + text-decoration: none; + vertical-align: baseline; + text-transform: none; + font-family: "Times New Roman"; +} +P.Code { + display: block; + text-align: left; + text-indent: 0.000000pt; + margin-top: 0.000000pt; + margin-bottom: 0.000000pt; + margin-right: 0.000000pt; + margin-left: 0.000000pt; + font-size: 9.000000pt; + font-weight: medium; + font-style: normal; + color: #000000; + text-decoration: none; + vertical-align: baseline; + text-transform: none; + font-family: "Courier New"; +} +P.Code-Indented { + display: block; + text-align: left; + text-indent: 0.000000pt; + margin-top: 0.000000pt; + margin-bottom: 0.000000pt; + margin-right: 0.000000pt; + margin-left: 18.000000pt; + font-size: 9.000000pt; + font-weight: medium; + font-style: normal; + color: #000000; + text-decoration: none; + vertical-align: baseline; + text-transform: none; + font-family: "Courier New"; +} +P.Code-Wide { + display: block; + text-align: left; + text-indent: 0.000000pt; + margin-top: 0.000000pt; + margin-bottom: 0.000000pt; + margin-right: 0.000000pt; + margin-left: 0.000000pt; + font-size: 9.000000pt; + font-weight: medium; + font-style: Regular; + color: #000000; + text-decoration: none; + vertical-align: baseline; + text-transform: none; + font-family: "Courier New"; +} +P.Company { + display: block; + text-align: left; + text-indent: 0.000000pt; + margin-top: 1.000000pt; + margin-bottom: 1.000000pt; + margin-right: 0.000000pt; + margin-left: 1.000076pt; + font-size: 10.000000pt; + font-weight: Bold; + font-style: Regular; + color: #000000; + text-decoration: none; + vertical-align: baseline; + text-transform: none; + font-family: "Arial"; +} +P.Company-Copyright { + display: block; + text-align: left; + text-indent: 0.000000pt; + margin-top: 0.000000pt; + margin-bottom: 0.000000pt; + margin-right: 0.000000pt; + margin-left: 1.000076pt; + font-size: 8.000000pt; + font-weight: normal; + font-style: Regular; + color: #000000; + text-decoration: none; + vertical-align: baseline; + text-transform: none; + font-family: "Arial"; +} +P.date-stamp { + display: block; + text-align: left; + text-indent: 0.000000pt; + margin-top: 0.000000pt; + margin-bottom: 0.000000pt; + margin-right: 0.000000pt; + margin-left: 0.000000pt; + font-size: 6.000000pt; + font-weight: medium; + font-style: Regular; + color: #ff0000; + text-decoration: none; + vertical-align: baseline; + text-transform: none; + font-family: "Arial"; +} +P.Example-Caption { + display: block; + text-align: left; + text-indent: 0.000000pt; + margin-top: 6.000000pt; + margin-bottom: 0.000000pt; + margin-right: 0.000000pt; + margin-left: 0.000000pt; + font-size: 10.000000pt; + font-weight: medium; + font-style: Italic; + color: #000000; + text-decoration: none; + vertical-align: baseline; + text-transform: none; + font-family: "Times New Roman"; +} +P.Example-End { + display: block; + text-align: left; + text-indent: 0.000000pt; + margin-top: 0.000000pt; + margin-bottom: 0.000000pt; + margin-right: 0.000000pt; + margin-left: 9.000000pt; + font-size: 10.000000pt; + font-weight: medium; + font-style: Regular; + color: #000000; + text-decoration: none; + vertical-align: baseline; + text-transform: none; + font-family: "Times New Roman"; +} +LI.Example-Title { + display: block; + text-align: left; + text-indent: 0.000000pt; + margin-top: 10.000000pt; + margin-bottom: 5.000000pt; + margin-right: 0.000000pt; + margin-left: 9.000000pt; + font-size: 10.000000pt; + font-weight: Bold; + font-style: Regular; + color: #000000; + text-decoration: none; + vertical-align: baseline; + text-transform: none; + font-family: "Times New Roman"; +} +P.Figure-Caption { + display: block; + text-align: left; + text-indent: 0.000000pt; + margin-top: 6.000000pt; + margin-bottom: 0.000000pt; + margin-right: 0.000000pt; + margin-left: 0.000000pt; + font-size: 10.000000pt; + font-weight: medium; + font-style: Italic; + color: #000000; + text-decoration: none; + vertical-align: baseline; + text-transform: none; + font-family: "Times New Roman"; +} +H1.Figure-End, H2.Figure-End, H3.Figure-End, H4.Figure-End, H5.Figure-End, H6.Figure-End { + display: block; + text-align: left; + text-indent: 0.000000pt; + margin-top: 0.000000pt; + margin-bottom: 0.000000pt; + margin-right: 0.000000pt; + margin-left: 9.000000pt; + font-size: 10.000000pt; + font-weight: medium; + font-style: Regular; + color: #000000; + text-decoration: none; + vertical-align: baseline; + text-transform: none; + font-family: "Times New Roman"; +} +H1.Figure-Title, H2.Figure-Title, H3.Figure-Title, H4.Figure-Title, H5.Figure-Title, H6.Figure-Title { + display: block; + text-align: left; + text-indent: 0.000000pt; + margin-top: 10.000000pt; + margin-bottom: 5.000000pt; + margin-right: 0.000000pt; + margin-left: 9.000000pt; + font-size: 10.000000pt; + font-weight: Bold; + font-style: Regular; + color: #000000; + text-decoration: none; + vertical-align: baseline; + text-transform: none; + font-family: "Times New Roman"; +} +P.FigureBody10 { + display: block; + text-align: center; + text-indent: 0.000000pt; + margin-top: 0.000000pt; + margin-bottom: 0.000000pt; + margin-right: 0.000000pt; + margin-left: 0.000000pt; + font-size: 10.000000pt; + font-weight: medium; + font-style: Regular; + color: #000000; + text-decoration: none; + vertical-align: baseline; + text-transform: none; + font-family: "Times New Roman"; +} +P.FigureBody10Left { + display: block; + text-align: left; + text-indent: 0.000000pt; + margin-top: 0.000000pt; + margin-bottom: 0.000000pt; + margin-right: 0.000000pt; + margin-left: 0.000000pt; + font-size: 10.000000pt; + font-weight: medium; + font-style: Regular; + color: #000000; + text-decoration: none; + vertical-align: baseline; + text-transform: none; + font-family: "Times New Roman"; +} +P.FigureTag10 { + display: block; + text-align: center; + text-indent: 0.000000pt; + margin-top: 0.000000pt; + margin-bottom: 0.000000pt; + margin-right: 0.000000pt; + margin-left: 0.000000pt; + font-size: 10.000000pt; + font-weight: Bold; + font-style: Regular; + color: #000000; + text-decoration: none; + vertical-align: baseline; + text-transform: none; + font-family: "Arial"; +} +P.FigureTag8 { + display: block; + text-align: center; + text-indent: 0.000000pt; + margin-top: 0.000000pt; + margin-bottom: 0.000000pt; + margin-right: 0.000000pt; + margin-left: 0.000000pt; + font-size: 8.000000pt; + font-weight: Bold; + font-style: Regular; + color: #000000; + text-decoration: none; + vertical-align: baseline; + text-transform: none; + font-family: "Arial"; +} +P.FigureTag9 { + display: block; + text-align: center; + text-indent: 0.000000pt; + margin-top: 0.000000pt; + margin-bottom: 0.000000pt; + margin-right: 0.000000pt; + margin-left: 0.000000pt; + font-size: 9.000000pt; + font-weight: Bold; + font-style: Regular; + color: #000000; + text-decoration: none; + vertical-align: baseline; + text-transform: none; + font-family: "Arial"; +} +P.footer { + display: block; + text-align: justify; + text-indent: 0.000000pt; + margin-top: 0.000000pt; + margin-bottom: 0.000000pt; + margin-right: 0.000000pt; + margin-left: 0.000000pt; + font-size: 8.000000pt; + font-weight: medium; + font-style: Regular; + color: #000000; + text-decoration: none; + vertical-align: baseline; + text-transform: none; + font-family: "Arial"; +} +P.Hang-Indent { + display: block; + text-align: left; + text-indent: -72.000000pt; + margin-top: 6.000000pt; + margin-bottom: 6.000000pt; + margin-right: 0.000000pt; + margin-left: 90.000000pt; + font-size: 10.000000pt; + font-weight: medium; + font-style: Regular; + color: #000000; + text-decoration: none; + vertical-align: baseline; + text-transform: none; + font-family: "Times New Roman"; +} +H1.Head-A, H2.Head-A, H3.Head-A, H4.Head-A, H5.Head-A, H6.Head-A { + display: block; + text-align: left; + text-indent: 0.000000pt; + margin-top: 24.000000pt; + margin-bottom: 6.000000pt; + margin-right: 0.000000pt; + margin-left: 0.000000pt; + font-size: 16.000000pt; + font-weight: Bold; + font-style: Regular; + color: #000000; + text-decoration: none; + vertical-align: baseline; + text-transform: none; + font-family: "Arial"; +} +P.Head-A-noNum { + display: block; + text-align: left; + text-indent: 0.000000pt; + margin-top: 24.000000pt; + margin-bottom: 6.000000pt; + margin-right: 0.000000pt; + margin-left: 0.000000pt; + font-size: 16.000000pt; + font-weight: Bold; + font-style: Regular; + color: #000000; + text-decoration: none; + vertical-align: baseline; + text-transform: none; + font-family: "Arial"; +} +H1.Head-B, H2.Head-B, H3.Head-B, H4.Head-B, H5.Head-B, H6.Head-B { + display: block; + text-align: left; + text-indent: 0.000000pt; + margin-top: 17.000000pt; + margin-bottom: 6.000000pt; + margin-right: 0.000000pt; + margin-left: 0.000000pt; + font-size: 14.000000pt; + font-weight: Bold; + font-style: normal; + color: #000000; + text-decoration: none; + vertical-align: baseline; + text-transform: none; + font-family: "Arial"; +} +H1.Head-C, H2.Head-C, H3.Head-C, H4.Head-C, H5.Head-C, H6.Head-C { + display: block; + text-align: left; + text-indent: 0.000000pt; + margin-top: 14.000000pt; + margin-bottom: 4.000000pt; + margin-right: 0.000000pt; + margin-left: 0.000000pt; + font-size: 12.000000pt; + font-weight: Bold; + font-style: normal; + color: #000000; + text-decoration: none; + vertical-align: baseline; + text-transform: none; + font-family: "Arial"; +} +P.Head-D { + display: block; + text-align: left; + text-indent: 0.000000pt; + margin-top: 12.000000pt; + margin-bottom: 0.000000pt; + margin-right: 0.000000pt; + margin-left: 0.000000pt; + font-size: 10.000000pt; + font-weight: Bold; + font-style: Regular; + color: #000000; + text-decoration: none; + vertical-align: baseline; + text-transform: none; + font-family: "Arial"; +} +P.header { + display: block; + text-align: justify; + text-indent: 0.000000pt; + margin-top: 0.000000pt; + margin-bottom: 0.000000pt; + margin-right: 0.000000pt; + margin-left: 0.000000pt; + font-size: 8.000000pt; + font-weight: medium; + font-style: Regular; + color: #000000; + text-decoration: none; + vertical-align: baseline; + text-transform: none; + font-family: "Arial"; +} +P.Indented { + display: block; + text-align: left; + text-indent: 0.000000pt; + margin-top: 6.000000pt; + margin-bottom: 6.000000pt; + margin-right: 0.000000pt; + margin-left: 18.000000pt; + font-size: 10.000000pt; + font-weight: medium; + font-style: Regular; + color: #000000; + text-decoration: none; + vertical-align: baseline; + text-transform: none; + font-family: "Arial"; +} +P.IndentedTwice { + display: block; + text-align: left; + text-indent: 0.000000pt; + margin-top: 6.000000pt; + margin-bottom: 6.000000pt; + margin-right: 0.000000pt; + margin-left: 36.000000pt; + font-size: 10.000000pt; + font-weight: medium; + font-style: Regular; + color: #000000; + text-decoration: none; + vertical-align: baseline; + text-transform: none; + font-family: "Arial"; +} +P.Note { + display: block; + text-align: left; + text-indent: 0.000000pt; + margin-top: 0.000000pt; + margin-bottom: 12.000000pt; + margin-right: 36.000000pt; + margin-left: 36.000000pt; + font-size: 10.000000pt; + font-weight: medium; + font-style: Italic; + color: #000000; + text-decoration: none; + vertical-align: baseline; + text-transform: none; + font-family: "Arial"; +} +LI.Numbered { + display: block; + text-align: left; + text-indent: -18.000000pt; + margin-top: 6.000000pt; + margin-bottom: 6.000000pt; + margin-right: 0.000000pt; + margin-left: 18.000000pt; + font-size: 10.000000pt; + font-weight: medium; + font-style: Regular; + color: #000000; + text-decoration: none; + vertical-align: baseline; + text-transform: none; + font-family: "Arial"; +} +LI.Numbered-1st { + display: block; + text-align: left; + text-indent: -18.000000pt; + margin-top: 6.000000pt; + margin-bottom: 6.000000pt; + margin-right: 0.000000pt; + margin-left: 18.000000pt; + font-size: 10.000000pt; + font-weight: medium; + font-style: Regular; + color: #000000; + text-decoration: none; + vertical-align: baseline; + text-transform: none; + font-family: "Arial"; +} +LI.NumberedA { + display: block; + text-align: left; + text-indent: -18.000000pt; + margin-top: 6.000000pt; + margin-bottom: 6.000000pt; + margin-right: 0.000000pt; + margin-left: 36.000000pt; + font-size: 10.000000pt; + font-weight: medium; + font-style: Regular; + color: #000000; + text-decoration: none; + vertical-align: baseline; + text-transform: none; + font-family: "Arial"; +} +LI.NumberedA-1st { + display: block; + text-align: left; + text-indent: -18.000000pt; + margin-top: 6.000000pt; + margin-bottom: 6.000000pt; + margin-right: 0.000000pt; + margin-left: 36.000000pt; + font-size: 10.000000pt; + font-weight: medium; + font-style: Regular; + color: #000000; + text-decoration: none; + vertical-align: baseline; + text-transform: none; + font-family: "Arial"; +} +H1.TableTitle, H2.TableTitle, H3.TableTitle, H4.TableTitle, H5.TableTitle, H6.TableTitle { + display: block; + text-align: left; + text-indent: 0.000000pt; + margin-top: 0.000000pt; + margin-bottom: 0.000000pt; + margin-right: 0.000000pt; + margin-left: 9.000000pt; + font-size: 10.000000pt; + font-weight: Bold; + font-style: Regular; + color: #000000; + text-decoration: none; + vertical-align: baseline; + text-transform: none; + font-family: "Arial"; +} +H1.Title-Date, H2.Title-Date, H3.Title-Date, H4.Title-Date, H5.Title-Date, H6.Title-Date { + display: block; + text-align: center; + text-indent: 0pt; + margin-top: 0pt; + margin-bottom: 15pt; + margin-right: 0pt; + margin-left: 0pt; + font-size: 12pt; + font-weight: medium; + font-style: normal; + color: #000000; + text-decoration: none; + vertical-align: baseline; + text-transform: none; + font-family: "Times New Roman"; +} +H1.Title2, H2.Title2, H3.Title2, H4.Title2 { + display: block; + text-align: center; + text-indent: 0pt; + margin-top: 0pt; + margin-bottom: 0pt; + margin-right: 0pt; + margin-left: 0pt; + font-size: 24pt; + font-weight: Bold; + font-style: Italic; + color: #000000; + text-decoration: none; + vertical-align: baseline; + text-transform: none; + font-family: "Times New Roman"; +} +H5.Title2, H6.Title2 { + display: block; + text-align: center; + text-indent: 0pt; + margin-top: 0pt; + margin-bottom: 0pt; + margin-right: 0pt; + margin-left: 0pt; + font-size: 16pt; + font-weight: Bold; + font-style: Italic; + color: #000000; + text-decoration: none; + vertical-align: baseline; + text-transform: none; + font-family: "Times New Roman"; +} +H1.Version, H2.Version, H3.Version, H4.Version, H5.Version, H6.Version { + display: block; + text-align: center; + text-indent: 0pt; + margin-top: 0pt; + margin-bottom: 0pt; + margin-right: 0pt; + margin-left: 0pt; + font-size: 18pt; + font-weight: medium; + font-style: Regular; + color: #000000; + text-decoration: none; + vertical-align: baseline; + text-transform: none; + font-family: "Times New Roman"; +} +EM.Body { + font-size: 10.000000pt; + font-weight: medium; + font-style: Regular; + font-family: "Arial"; +} +EM.Body8 { + font-size: 8.000000pt; + font-weight: medium; + font-style: Regular; + color: #000000; + text-decoration: none; + vertical-align: baseline; + text-transform: none; + font-family: "Arial"; +} +EM.Body9 { + font-size: 9.000000pt; + font-weight: medium; + font-style: Regular; + font-family: "Arial"; +} +EM.Bold { + font-weight: Bold; + text-decoration: none; + vertical-align: baseline; + text-transform: none; +} +EM.Chapter- { + font-size: 75.000000pt; + font-weight: Bold; + font-style: Regular; + vertical-align: sub; + font-family: "Times New Roman"; +} +EM.Code10Bold { + font-size: 10.000000pt; + font-weight: Bold; + font-style: Regular; + color: #000000; + text-decoration: none; + vertical-align: baseline; + text-transform: none; + font-family: "Courier New"; +} +EM.Code9 { + font-size: 9pt; + font-weight: normal; + font-style: normal; + color: #000000; + text-decoration: none; + vertical-align: baseline; + text-transform: none; + font-family: "Courier New"; +} +EM.FigureBody { + font-size: 8.000000pt; + font-weight: medium; + font-style: Regular; + color: #000000; + text-decoration: none; + vertical-align: baseline; + text-transform: none; + font-family: "Arial"; +} +EM.FigureBoldWhite { + font-weight: Bold; + color: #ffffff; + text-decoration: none; + vertical-align: baseline; + text-transform: none; +} +EM.hypertext { + font-size: 10.000000pt; + font-weight: medium; + font-style: Regular; + color: #2328a8; + text-decoration: none; + vertical-align: baseline; + text-transform: none; + font-family: "Times New Roman"; +} +EM.Italic { + font-style: Italic; + text-decoration: none; + vertical-align: baseline; + text-transform: none; +} +EM.Subscript { + vertical-align: sub; +} +EM.Superscript { + vertical-align: super; +} +EM.Symbol9 { + font-size: 9.000000pt; + font-weight: medium; + font-style: Regular; + color: #000000; + text-decoration: none; + vertical-align: baseline; + text-transform: none; + font-family: "Symbol"; +} +EM.SymbolFont { + font-family: "Symbol"; +} +EM.TagTitle { + font-size: 16.000000pt; + font-weight: medium; + font-style: Italic; + color: #000000; + text-decoration: none; + vertical-align: baseline; + text-transform: none; + font-family: "Times New Roman"; +} +EM.TextRed { + font-size: 10.000000pt; + font-weight: medium; + font-style: Regular; + color: #c45468; + text-decoration: none; + vertical-align: baseline; + text-transform: none; + font-family: "Times New Roman"; +} +EM.URL { + font-size: 10.000000pt; + font-weight: medium; + font-style: Regular; + color: #2328a8; + text-decoration: underline ; + vertical-align: baseline; + text-transform: none; + font-family: "Times New Roman"; +} +EM.Webding { + font-size: 10.000000pt; + font-weight: medium; + font-style: Regular; + color: #000000; + text-decoration: none; + vertical-align: baseline; + text-transform: none; + font-family: "Webdings"; +} +EM.webdingsRed { + font-size: 10.000000pt; + font-weight: medium; + font-style: Regular; + color: #c45468; + text-decoration: none; + vertical-align: baseline; + text-transform: none; + font-family: "Webdings"; +} +EM.webdingsRed8 { + font-size: 8.000000pt; + font-weight: medium; + font-style: Regular; + color: #c45468; + text-decoration: none; + vertical-align: baseline; + text-transform: none; + font-family: "Webdings"; +} +EM.zd10red { + font-size: 10.000000pt; + font-weight: medium; + font-style: Regular; + color: #000000; + text-decoration: none; + vertical-align: baseline; + text-transform: none; + font-family: "Times New Roman"; +} +P.Body { + + display: block; + text-align: left; + text-indent: 0pt; + margin-top: 5pt; + margin-bottom: 5pt; + margin-right: 0pt; + margin-left: 0pt; + font-size: 10pt; + font-weight: normal; + font-style: normal; + color: #000000; + text-decoration: none; + vertical-align: baseline; + text-transform: none; + font-family: "Arial"; +} +P.Body { + + display: block; + text-align: left; + text-indent: 0pt; + margin-top: 5pt; + margin-bottom: 5pt; + margin-right: 0pt; + margin-left: 0pt; + font-size: 10pt; + font-weight: normal; + font-style: normal; + color: #000000; + text-decoration: none; + vertical-align: baseline; + text-transform: none; + font-family: "Arial"; +} http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/ac967000/geode-client-native/examples/clicache/HelloWorld/HelloWorld.cs ---------------------------------------------------------------------- diff --git a/geode-client-native/examples/clicache/HelloWorld/HelloWorld.cs b/geode-client-native/examples/clicache/HelloWorld/HelloWorld.cs new file mode 100644 index 0000000..6dab63d --- /dev/null +++ b/geode-client-native/examples/clicache/HelloWorld/HelloWorld.cs @@ -0,0 +1,99 @@ +/*========================================================================= + * 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 HelloWorld + { + + #region Local constants + + //private static Cache cache = null; + private static Region region = null; + + private static string strKey = "abc"; + private static string strValue = "Hello, World!"; + + private static int intKey = 777; + private static int intValue = 12345678; + + #endregion + + static void Main() + { + try + { + // Create a GemFire Cache. + CacheFactory cacheFactory = CacheFactory.CreateCacheFactory(null); + Cache cache = cacheFactory.Create(); + + Console.WriteLine("Created the GemFire Cache"); + + RegionFactory regionFactory = cache.CreateRegionFactory(RegionShortcut.LOCAL); + + // Create the example Region programmatically. + region = regionFactory.Create("exampledsregion"); + + // Put some entries + Console.WriteLine("{0}Putting entries", Environment.NewLine); + PutStr(strKey, strValue); + PutInt(intKey, intValue); + + // Get the entries + Console.WriteLine("{0}Getting entries", Environment.NewLine); + string getStr = GetStr(strKey); + int getInt = GetInt(intKey); + + // Close cache + cache.Close(); + Console.WriteLine("Closed the cache."); + + } + catch (Exception ex) + { + Console.WriteLine("{0}An exception occurred: {1}", Environment.NewLine, ex); + Console.WriteLine("---[ Press to End the Application ]---"); + Console.ReadLine(); + } + } + + #region Local functions + + public static void PutInt(int key, int value) + { + region.Put(key, value); + Console.WriteLine(" Put integer -- key: " + key + " value: " + value); + } + + public static int GetInt(int key) + { + CacheableInt32 cValue = region.Get(key) as CacheableInt32; + + Console.WriteLine(" Get integer -- key: " + key + " value: " + cValue.Value); + return cValue.Value; + } + + public static void PutStr(string key, string value) + { + region.Put(key, value); + Console.WriteLine(" Put string -- key: " + key + " value: " + value); + } + + public static string GetStr(string key) + { + IGFSerializable cValue = region.Get(key); + + Console.WriteLine(" Get string -- key: " + key + " value: " + cValue); + return cValue.ToString(); + } + + #endregion + } +} http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/ac967000/geode-client-native/examples/clicache/HelloWorld/HelloWorld.csproj ---------------------------------------------------------------------- diff --git a/geode-client-native/examples/clicache/HelloWorld/HelloWorld.csproj b/geode-client-native/examples/clicache/HelloWorld/HelloWorld.csproj new file mode 100644 index 0000000..c0473c4 --- /dev/null +++ b/geode-client-native/examples/clicache/HelloWorld/HelloWorld.csproj @@ -0,0 +1,85 @@ + + + Debug + AnyCPU + 8.0.50727 + 2.0 + {5DE79CEE-BEE8-404E-8365-2AE742001EEA} + Exe + Properties + GemStone.GemFire.Cache.Examples + HelloWorld + + + 2.0 + + + + + true + full + false + $(OSBUILDDIR)\examples\clicache\Debug\HelloWorld\ + $(OSBUILDDIR)\examples\clicache\Debug\HelloWorld\ + DEBUG;TRACE + prompt + 4 + x86 + 618 + + + pdbonly + true + $(OSBUILDDIR)\examples\clicache\HelloWorld\ + $(OSBUILDDIR)\examples\clicache\HelloWorld\ + TRACE + prompt + 4 + x86 + 618 + + + true + $(OSBUILDDIR)\examples\clicache\Debug\HelloWorld\ + $(OSBUILDDIR)\examples\clicache\Debug\HelloWorld\ + DEBUG;TRACE + full + false + x64 + prompt + 4 + 618 + + + $(OSBUILDDIR)\examples\clicache\HelloWorld\ + $(OSBUILDDIR)\examples\clicache\HelloWorld\ + TRACE + true + pdbonly + x64 + prompt + 4 + 618 + + + + + + + + + + + {B274E3B1-6A09-4322-952B-8BDA712892CE} + gfclicache + + + + + \ No newline at end of file http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/ac967000/geode-client-native/examples/clicache/HelloWorld/HelloWorld.csproj.user ---------------------------------------------------------------------- diff --git a/geode-client-native/examples/clicache/HelloWorld/HelloWorld.csproj.user b/geode-client-native/examples/clicache/HelloWorld/HelloWorld.csproj.user new file mode 100644 index 0000000..957e734 --- /dev/null +++ b/geode-client-native/examples/clicache/HelloWorld/HelloWorld.csproj.user @@ -0,0 +1,5 @@ + + + $(OSBUILDDIR)\hidden\lib\ + + \ No newline at end of file http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/ac967000/geode-client-native/examples/clicache/HelloWorld/Properties/AssemblyInfo.cs ---------------------------------------------------------------------- diff --git a/geode-client-native/examples/clicache/HelloWorld/Properties/AssemblyInfo.cs b/geode-client-native/examples/clicache/HelloWorld/Properties/AssemblyInfo.cs new file mode 100644 index 0000000..3326db0 --- /dev/null +++ b/geode-client-native/examples/clicache/HelloWorld/Properties/AssemblyInfo.cs @@ -0,0 +1,33 @@ +using 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("GemFireHelloWorld")] +[assembly: AssemblyDescription("GemFire Simple PutGet Example")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("GemStone Systems Inc.")] +[assembly: AssemblyProduct("GemFireHelloWorld")] +[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("5b9cfc0d-3951-4b9f-9ffd-f7a50e9d2f1a")] + +// 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/HelloWorld/README.html ---------------------------------------------------------------------- diff --git a/geode-client-native/examples/clicache/HelloWorld/README.html b/geode-client-native/examples/clicache/HelloWorld/README.html new file mode 100644 index 0000000..56d8ce8 --- /dev/null +++ b/geode-client-native/examples/clicache/HelloWorld/README.html @@ -0,0 +1,117 @@ + + + + HelloWorld: Pivotal GemFire Native® Client C# Example + + + + + + + +
+

HelloWorld

+

+
Pivotal GemFire® Native Client C# +
C# API Programming Example +

+

The HelloWorld example + demonstrates the simplest functionality of the GemFire Native Client C# product: +

+
    +
  1. +

    Create a GemFire cache.

    +
  2. +

    Create a local region.

    +
  3. +

    Put some keys and values into the region.

    +
  4. +

    Get those keys and values.

    +
  5. +

    Close the cache.

    +
  6. +
+
+

The sample code is located in the Native Client SampleCode examples/HelloWorld. +

+

To view the GemFire manuals, the online API documentation, and + the complete set of examples, see docs/index.html in the Native Client Installation. +

+ +

Setting Up the Environment +

+

Verify that there is a valid gfCppLicense.zip + file, version 1.1, in the GemFireProductDirectory.

+

Create a file in the projects  .../bin + directory named gfcpp.properties containing the + following two lines:

+

# turn off most log messages +

+

log-level=error  +

+

The GemFire - C# product requires an environment variable, GFCPP for the product base path.

+

Cygwin:

+

export GFCPP=GemFireProductDirectory +

+

export PATH=$GFCPP/bin:$PATH

+

Windows:

+

set GFCPP=GemFireProductDirectory  

+

PATH=%GFCPP%/bin;%PATH%

+

Running HelloWorld +

+

Run the HelloWorld + executable. There are no command line arguments. +

Cygwin:

+

cd .../bin

+

./HelloWorld.exe +

+

+

+

Windows: +

+ +

cd ...\bin

+

HelloWorld.exe +

+

+ +

 

+

The output is: +

+

+ Created the GemFire Cache

+

+

+

Putting entries +

+

Put string  -- key: abc value: Hello, + world! +

+

+ Put integer -- key: 777 value: 12345678 +

+

+

+

Getting entries +

+

Get string  -- key: abc value: Hello, + world! +

+

Get integer -- key: 777 value: 12345678 +

+

 

+

Closed the cache.

+

+

+

 

+ +

+  

+

+ + + http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/ac967000/geode-client-native/examples/clicache/HierarchicalClient/HierarchicalClient.cs ---------------------------------------------------------------------- diff --git a/geode-client-native/examples/clicache/HierarchicalClient/HierarchicalClient.cs b/geode-client-native/examples/clicache/HierarchicalClient/HierarchicalClient.cs new file mode 100755 index 0000000..e4f92d7 --- /dev/null +++ b/geode-client-native/examples/clicache/HierarchicalClient/HierarchicalClient.cs @@ -0,0 +1,256 @@ +/*========================================================================= + * 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. + *========================================================================= + * + * This example demonstrates client/server caching. This is a classic + * client-server architecture (versus peer-to-peer). This program starts a client + * that connects to a server so it can request, update, and delete data. + * + * While this example uses a console application, it is not a requirement. + * + * Please note that this example requires that the GemFire HierarchicalServer + * process to be running prior to execution. To start the HierarchicalServer + * QuickStart example, please refer to the GemFire Quickstart documentation. + * +//////////////////////////////////////////////////////////////////////////////*/ +using System; + +// These namespaces provide access to classes needed to interact with GemFire. +using GemStone.GemFire.Cache; + +public class HierarchicalClient +{ + public static void Main() + { + DistributedSystem MyDistributedSystem = null; + Cache MyCache = null; + string sKey = null; + CacheableString sValue = null; + + try + { + Console.WriteLine("* Connecting to the distributed system and creating the cache."); + + /* Properties can be passed to GemFire through two different mechanisms: the + * Properties object as is done below or the gemfire.properties file. The + * settings passed in a Properties object take precedence over any settings + * in a file. This way the end-user cannot bypass any required settings. + * + * Using a gemfire.properties file can be useful when you want to change the + * behavior of certain settings without doing a new build, test, and deploy cycle. + * + * See gemfire.properties for details on some of the other settings used in this + * project. + * + * For details on all of the possible settings and their respective values + * that can be specified in this configuration file, see chapter 5, + * "System Configuration", in the "System Administrator's Guide". This is + * installed in the docs\pdf folder under the GemFire installation folder + * (e.g., C:\Program Files\Gemfire5\docs\pdf\SystemAdmin.pdf). + */ + Properties DistributedSystemProperties = new Properties(); + + DistributedSystemProperties.Insert("name", "CacheClient"); + + /* Specify the file whose contents are used to initialize the cache when it is created. + * + * An XML file isn't needed at all because everything can be specified in code--much + * as the "license-file" property is. However, it provides a convenient way + * to isolate common settings that can be updated without a build/test/deploy cycle. + */ + DistributedSystemProperties.Insert("cache-xml-file", "HierarchicalClient.xml"); + + /* Define where the license file is located. It is very useful to do this in + * code vs. the gemfire.properties file, because it allows you to access the + * license used by the GemFire installation (as pointed to by the GEMFIRE + * environment variable). + */ + DistributedSystemProperties.Insert("license-file", "../../gfCppLicense.zip"); + + DistributedSystemProperties.Insert("log-file", "./csharpclient.log"); + DistributedSystemProperties.Insert("log-level", "finest"); + + /* Override the mcast-port setting so the client runs "standalone". + The client and server must run in separate distributed systems. + */ + //DistributedSystemProperties.Insert("mcast-port", "0"); + + // Connect to the GemFire distributed system. + MyDistributedSystem = DistributedSystem.Connect("LocalDS", DistributedSystemProperties); + + /*////////////////////////////////////////////////////////////////////////////// + * + * Create the cache. + * + //////////////////////////////////////////////////////////////////////////////*/ + + // Create the cache. This causes the cache-xml-file to be parsed. + MyCache = CacheFactory.Create("localCache", MyDistributedSystem); + + /*////////////////////////////////////////////////////////////////////////////// + * + * Create the region. + * + //////////////////////////////////////////////////////////////////////////////*/ + + // Prepare the attributes needed to create a sub-region. + AttributesFactory MyAttributesFactory = new AttributesFactory(); + + /* The "scope" determines how changes to the local cache are "broadcast" + * to like-named regions in other caches. + * + * For native clients DistributedAck and DistributedNoAck work + * identically. + */ + MyAttributesFactory.SetScope(ScopeType.DistributedAck); + + /* Endpoints is a comma delimited list of logical names, hostnames, and ports of + * "server" caches with which to connect. The endpoints parameter follows this syntax: + * + * logicalName1=host1:port1, . . . ,logicalNameN=hostN:portN + */ + MyAttributesFactory.SetEndpoints("localhost:40404"); + MyAttributesFactory.SetClientNotificationEnabled(true); + + /* Because of implementation details, it is best not to cache data in a root-level + * region. There is nothing special about the name "root", it is just a good naming + * convention. + * + * Get the "root" region from the cache and create a sub-region under it for the + * data. + */ + Region MyExampleRegion = MyCache.GetRegion("root").CreateSubRegion( + "exampleRegion", MyAttributesFactory.CreateRegionAttributes()); + + Console.WriteLine(String.Format("{0}* Region, {1}, was created in the cache.", + Environment.NewLine, MyExampleRegion.FullPath)); + Console.WriteLine("* Getting three values from the Hierarchical Server."); + + // Retrieve several values from the cache. + for (int nCount = 0; nCount < 4; nCount++) + { + sKey = string.Format("Key{0}", nCount); + + Console.WriteLine(String.Format("* Requesting object: {0}{1}", + sKey, Environment.NewLine)); + + /* Request the object from the cache. Because it doesn't exist in the local + * cache, it will be passed to the server. Because the server doesn't have + * it, the request will be passed to SimpleCacheLoader.Load(). The entry + * returned is a string. + */ + sValue = MyExampleRegion.Get(sKey) as CacheableString; + + Console.WriteLine(String.Format("* Retrieved object: ({0})", sValue.ToString())); + } + + Console.WriteLine("* If you look at the Cache Server's console, you can see the CacheListener notifications that happened in response to the gets."); + Console.WriteLine("{0}---[ Press to continue. ]---", Environment.NewLine); + + + Console.ReadLine(); + + /*////////////////////////////////////////////////////////////////////////////// + * + * Exercise the serialization and deserialization methods. + * + //////////////////////////////////////////////////////////////////////////////*/ + + // Demonstrate the process needed to manually deserialize the object from the cache. + Console.WriteLine(string.Format("* Manually deserializing the object for Key0: ({0})", MyExampleRegion.Get("Key0"))); + + // Demonstrate the static FromCache method in the CachedItem class and modify the object. + Console.WriteLine("* Using the FromCache() method and modifying the object for Key0"); + + // Get the item. + //sValue = (CacheableString)MyExampleRegion.Get("Key0"); + sValue = MyExampleRegion.Get("Key0") as CacheableString; + + Console.WriteLine(string.Format("* Original value: ({0})", sValue.ToString())); + + /* This modifies the object associated with Key0 and uses CacheSerializer + * to perform manual serialization. + */ + String cachedItem = "PDA"; + MyExampleRegion.Put("Key0", cachedItem); + + // Reread the object from the cache. + sValue = (CacheableString)MyExampleRegion.Get("Key0"); + + Console.WriteLine(string.Format("* Retrieved updated object: {0}", sValue)); + + Console.WriteLine("* Invalidating the data for Key2"); + + /* Invalidating a cached item causes the object to be removed, but the + * key remains in the cache. If it is subsequently requested it will + * be retrieved using a CacheLoader if possible. + */ + MyExampleRegion.Invalidate("Key2"); + + Console.WriteLine("* Requesting Key2 after the invalidation."); + + // Request the invalidated item. + sValue = (CacheableString)MyExampleRegion.Get("Key2"); + + Console.WriteLine(string.Format("* Retrieved object: {0}", sValue)); + + Console.WriteLine("* Destroying Key3"); + + // Destroying a cached item removes both the object and the key. + MyExampleRegion.Destroy("Key3"); + + Console.WriteLine("{0}---[ Press to End the Application ]---", + Environment.NewLine); + Console.ReadLine(); + } + catch (Exception ThrownException) + { + Console.Error.WriteLine(ThrownException.Message); + Console.Error.WriteLine(ThrownException.StackTrace); + Console.Error.WriteLine("---[ Press to End the Application ]---"); + Console.ReadLine(); + } + finally + { + /* While there are not any ramifications of terminating without closing the cache + * and disconnecting from the distributed system, it is considered a best practice + * to do so. + */ + try + { + Console.WriteLine("Closing the cache and disconnecting.{0}", + Environment.NewLine); + } + catch {/* Ignore any exceptions */} + + try + { + /* Close the cache. This terminates the cache and releases all the resources. + * Generally speaking, after a cache is closed, any further method calls on + * it or region object will throw an exception. + */ + MyCache.Close(); + } + catch {/* Ignore any exceptions */} + + try + { + /* Disconnect from the distributed system. + */ + MyDistributedSystem = null; + } + catch {/* Ignore any exceptions */} + } + } + + public static string GetStr(string key, Region region) + { + IGFSerializable cValue = region.Get(key); + + Console.WriteLine(" Get string -- key: " + key + " value: " + cValue.ToString()); + return cValue.ToString(); + } +} http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/ac967000/geode-client-native/examples/clicache/HierarchicalClient/HierarchicalClient.csproj ---------------------------------------------------------------------- diff --git a/geode-client-native/examples/clicache/HierarchicalClient/HierarchicalClient.csproj b/geode-client-native/examples/clicache/HierarchicalClient/HierarchicalClient.csproj new file mode 100755 index 0000000..ba70e16 --- /dev/null +++ b/geode-client-native/examples/clicache/HierarchicalClient/HierarchicalClient.csproj @@ -0,0 +1,86 @@ + + + Debug + AnyCPU + 8.0.50727 + 2.0 + {6F9455A8-866A-4405-8354-449BC6CDFD46} + Exe + Properties + GemStone.GemFire.Cache.Examples + HierarchicalClient + + + 2.0 + + + + + true + full + false + $(OSBUILDDIR)\examples\clicache\Debug\HierarchicalClient\ + $(OSBUILDDIR)\examples\clicache\Debug\HierarchicalClient\ + DEBUG;TRACE + prompt + 4 + + x86 + 618 + + + pdbonly + true + $(OSBUILDDIR)\examples\clicache\HierarchicalClient\ + $(OSBUILDDIR)\examples\clicache\HierarchicalClient\ + TRACE + prompt + 4 + x86 + 618 + + + true + $(OSBUILDDIR)\examples\clicache\Debug\HierarchicalClient\ + $(OSBUILDDIR)\examples\clicache\Debug\HierarchicalClient\ + DEBUG;TRACE + full + false + x64 + prompt + 4 + 618 + + + $(OSBUILDDIR)\examples\clicache\HierarchicalClient\ + $(OSBUILDDIR)\examples\clicache\HierarchicalClient\ + TRACE + true + pdbonly + x64 + prompt + 4 + 618 + + + + {B274E3B1-6A09-4322-952B-8BDA712892CE} + gfclicache + + + + + + + + + + + + \ No newline at end of file http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/ac967000/geode-client-native/examples/clicache/HierarchicalClient/HierarchicalClient.xml ---------------------------------------------------------------------- diff --git a/geode-client-native/examples/clicache/HierarchicalClient/HierarchicalClient.xml b/geode-client-native/examples/clicache/HierarchicalClient/HierarchicalClient.xml new file mode 100644 index 0000000..4be0995 --- /dev/null +++ b/geode-client-native/examples/clicache/HierarchicalClient/HierarchicalClient.xml @@ -0,0 +1,7 @@ + + + + + + + http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/ac967000/geode-client-native/examples/clicache/HierarchicalClient/Properties/AssemblyInfo.cs ---------------------------------------------------------------------- diff --git a/geode-client-native/examples/clicache/HierarchicalClient/Properties/AssemblyInfo.cs b/geode-client-native/examples/clicache/HierarchicalClient/Properties/AssemblyInfo.cs new file mode 100755 index 0000000..3edf8eb --- /dev/null +++ b/geode-client-native/examples/clicache/HierarchicalClient/Properties/AssemblyInfo.cs @@ -0,0 +1,33 @@ +using 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("Quick Start Examples")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("GemStone Systems, Inc.")] +[assembly: AssemblyProduct("Quick Start Examples")] +[assembly: AssemblyCopyright("Copyright © GemStone Systems, Inc. 2008")] +[assembly: AssemblyTrademark("")] +[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("ed332c93-70a1-4152-bd7f-8cf6cbf38528")] + +// 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")]