Summary: Build and run your first .NET application.
OverviewIn this section, we build and run .NET applications using the GigaSpaces PONO API in the following steps:
Installing GigaSpacesFor instructions on how to install XAP.NET, refer to the Installing XAP.NET section. Creating a New .NET Project
Project ReferencesAdd the GigaSpaces.Core.dll file located under GigaSpaces Root\Bin into your project references. Creating a Data Class
Write and Read Objects - the Applicationusing System; using System.Collections.Generic; using System.Text; using GigaSpaces.Core; namespace myHelloSpace { class Program { static void Main(string[] args) { // Getting space proxy ISpaceProxy space = SpaceProxyProviderFactory.Instance.FindSpace("rmi://localhost/./mySpace"); if (space != null) Console.WriteLine("Connect to space OK!"); MyData data = new MyData(); data.firstName = "Joe"; data.lastName = "lastname"; data.dob = new DateTime(1980, 1, 20, 10, 20, 0, DateTimeKind.Utc); // we write the data object into the space for a day space.Write<MyData>(data, null, 1000 * 60 * 24); Console.WriteLine("Wrote data to space OK!"); // read using simple template MyData template = new MyData(); template.firstName = "Joe"; template.dob = new DateTime(1900, 1, 1, 12, 0, 0, DateTimeKind.Utc); // null value MyData dataFromSpace = space.Read<MyData>(template, null, 1000); if (dataFromSpace != null) Console.WriteLine("Read data from space OK!"); Console.WriteLine("FirstName:" + dataFromSpace.firstName + " LastName:" + dataFromSpace.lastName + " Dob:" + dataFromSpace.dob); } } Starting the GigaSpaces Management CenterThe GigaSpaces Management Center is a graphical user interface that allows application developers and administrators to manage GigaSpaces components. Starting the Space
Building and Running the Application
For example: JAVA_HOME=D:\JDK\jdk1.5.0_04 JSHOMEDIR=C:\GigaSpacesXAP6.0
Viewing the Data inside the Space
Viewing Space EntriesSelect the myData class line, and click the Query button. The Query view is displayed. This shows your .NET PONO inside the space: |
![]() |
GigaSpaces.com - Legal Notice - 3rd Party Licenses - Site Map - API Docs - Forum - Downloads - Blog - White Papers - Contact Tech Writing - Gen. by Atlassian Confluence |