You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ignite.apache.org by vo...@apache.org on 2015/09/22 09:19:08 UTC

[06/37] ignite git commit: IGNITE-1513: WIP on .Net.

http://git-wip-us.apache.org/repos/asf/ignite/blob/a958801c/modules/platform/dotnet/examples/Apache.Ignite.ExamplesDll/Portable/EmployeeKey.cs
----------------------------------------------------------------------
diff --git a/modules/platform/dotnet/examples/Apache.Ignite.ExamplesDll/Portable/EmployeeKey.cs b/modules/platform/dotnet/examples/Apache.Ignite.ExamplesDll/Portable/EmployeeKey.cs
new file mode 100644
index 0000000..2267154
--- /dev/null
+++ b/modules/platform/dotnet/examples/Apache.Ignite.ExamplesDll/Portable/EmployeeKey.cs
@@ -0,0 +1,86 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+using System;
+
+namespace Apache.Ignite.ExamplesDll.Portable
+{
+    /// <summary>
+    /// Employee key. Used in query example to co-locate employees with their organizations.
+    /// </summary>
+    [Serializable]
+    public class EmployeeKey
+    {
+        /// <summary>
+        /// Constructor.
+        /// </summary>
+        /// <param name="id">ID.</param>
+        /// <param name="orgId">Organization ID.</param>
+        public EmployeeKey(int id, int orgId)
+        {
+            Id = id;
+            OrganizationId = orgId;
+        }
+
+        /// <summary>
+        /// ID.
+        /// </summary>
+        public int Id { get; private set; }
+
+        /// <summary>
+        /// Organization ID.
+        /// </summary>
+        public int OrganizationId { get; private set; }
+        
+        /// <summary>
+        /// Determines whether the specified <see cref="T:System.Object"/> is equal to the current <see cref="T:System.Object"/>.
+        /// </summary>
+        /// <returns>
+        /// true if the specified <see cref="T:System.Object"/> is equal to the current <see cref="T:System.Object"/>; otherwise, false.
+        /// </returns>
+        /// <param name="obj">The object to compare with the current object. </param><filterpriority>2</filterpriority>
+        public override bool Equals(object obj)
+        {
+            EmployeeKey other = obj as EmployeeKey;
+
+            return other != null && Id == other.Id && OrganizationId == other.OrganizationId;
+        }
+
+        /// <summary>
+        /// Serves as a hash function for a particular type. 
+        /// </summary>
+        /// <returns>
+        /// A hash code for the current <see cref="T:System.Object"/>.
+        /// </returns>
+        /// <filterpriority>2</filterpriority>
+        public override int GetHashCode()
+        {
+            return 31 * Id + OrganizationId;
+        }
+
+        /// <summary>
+        /// Returns a string that represents the current object.
+        /// </summary>
+        /// <returns>
+        /// A string that represents the current object.
+        /// </returns>
+        public override string ToString()
+        {
+            return string.Format("{0} [id={1}, organizationId={2}]", typeof (EmployeeKey).Name, Id, OrganizationId);
+        }
+    }
+}

http://git-wip-us.apache.org/repos/asf/ignite/blob/a958801c/modules/platform/dotnet/examples/Apache.Ignite.ExamplesDll/Portable/Organization.cs
----------------------------------------------------------------------
diff --git a/modules/platform/dotnet/examples/Apache.Ignite.ExamplesDll/Portable/Organization.cs b/modules/platform/dotnet/examples/Apache.Ignite.ExamplesDll/Portable/Organization.cs
new file mode 100644
index 0000000..e23c3c1
--- /dev/null
+++ b/modules/platform/dotnet/examples/Apache.Ignite.ExamplesDll/Portable/Organization.cs
@@ -0,0 +1,84 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+using System;
+
+namespace Apache.Ignite.ExamplesDll.Portable
+{
+    /// <summary>
+    /// Organization.
+    /// </summary>
+    [Serializable]
+    public class Organization
+    {
+        /// <summary>
+        /// Default constructor.
+        /// </summary>
+        public Organization()
+        {
+            // No-op.
+        }
+
+        /// <summary>
+        /// Constructor.
+        /// </summary>
+        /// <param name="name">Name.</param>
+        /// <param name="address">Address.</param>
+        /// <param name="type">Type.</param>
+        /// <param name="lastUpdated">Last update time.</param>
+        public Organization(string name, Address address, OrganizationType type, DateTime lastUpdated)
+        {
+            Name = name;
+            Address = address;
+            Type = type;
+            LastUpdated = lastUpdated;
+        }
+
+        /// <summary>
+        /// Name.
+        /// </summary>
+        public string Name { get; set; }
+
+        /// <summary>
+        /// Address.
+        /// </summary>
+        public Address Address { get; set; }
+
+        /// <summary>
+        /// Type.
+        /// </summary>
+        public OrganizationType Type { get; set; }
+
+        /// <summary>
+        /// Last update time.
+        /// </summary>
+        public DateTime LastUpdated { get; set; }
+
+        /// <summary>
+        /// Returns a string that represents the current object.
+        /// </summary>
+        /// <returns>
+        /// A string that represents the current object.
+        /// </returns>
+        /// <filterpriority>2</filterpriority>
+        public override string ToString()
+        {
+            return string.Format("{0} [name={1}, address={2}, type={3}, lastUpdated={4}]", typeof (Organization).Name,
+                Name, Address, Type, LastUpdated);
+        }
+    }
+}

http://git-wip-us.apache.org/repos/asf/ignite/blob/a958801c/modules/platform/dotnet/examples/Apache.Ignite.ExamplesDll/Portable/OrganizationType.cs
----------------------------------------------------------------------
diff --git a/modules/platform/dotnet/examples/Apache.Ignite.ExamplesDll/Portable/OrganizationType.cs b/modules/platform/dotnet/examples/Apache.Ignite.ExamplesDll/Portable/OrganizationType.cs
new file mode 100644
index 0000000..198edb1
--- /dev/null
+++ b/modules/platform/dotnet/examples/Apache.Ignite.ExamplesDll/Portable/OrganizationType.cs
@@ -0,0 +1,43 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+using System;
+
+namespace Apache.Ignite.ExamplesDll.Portable
+{
+    /// <summary>
+    /// Organization type.
+    /// </summary>
+    [Serializable]
+    public enum OrganizationType
+    {
+        /// <summary>
+        /// Non-profit organization.
+        /// </summary>
+        NonProfit,
+
+        /// <summary>
+        /// Private organization.
+        /// </summary>
+        Private,
+
+        /// <summary>
+        /// Government organization.
+        /// </summary>
+        Government
+    }
+}

http://git-wip-us.apache.org/repos/asf/ignite/blob/a958801c/modules/platform/dotnet/examples/Apache.Ignite.ExamplesDll/Properties/AssemblyInfo.cs
----------------------------------------------------------------------
diff --git a/modules/platform/dotnet/examples/Apache.Ignite.ExamplesDll/Properties/AssemblyInfo.cs b/modules/platform/dotnet/examples/Apache.Ignite.ExamplesDll/Properties/AssemblyInfo.cs
new file mode 100644
index 0000000..f149d64
--- /dev/null
+++ b/modules/platform/dotnet/examples/Apache.Ignite.ExamplesDll/Properties/AssemblyInfo.cs
@@ -0,0 +1,35 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+using System.Reflection;
+using System.Runtime.InteropServices;
+
+[assembly: AssemblyTitle("Apache Ignite Examples Dll")]
+[assembly: AssemblyDescription("")]
+[assembly: AssemblyConfiguration("")]
+[assembly: AssemblyCompany("Apache Software Foundation")]
+[assembly: AssemblyProduct("Apache Ignite")]
+[assembly: AssemblyCopyright("Copyright ©  2015")]
+[assembly: AssemblyTrademark("")]
+[assembly: AssemblyCulture("")]
+
+[assembly: ComVisible(false)]
+
+[assembly: Guid("ce65ec7c-d3cf-41ad-8f45-f90d5af68d77")]
+
+[assembly: AssemblyVersion("1.5.0")]
+[assembly: AssemblyFileVersion("1.5.0")]
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ignite/blob/a958801c/modules/platform/dotnet/examples/Apache.Ignite.ExamplesDll/Services/MapService.cs
----------------------------------------------------------------------
diff --git a/modules/platform/dotnet/examples/Apache.Ignite.ExamplesDll/Services/MapService.cs b/modules/platform/dotnet/examples/Apache.Ignite.ExamplesDll/Services/MapService.cs
new file mode 100644
index 0000000..d577ff7
--- /dev/null
+++ b/modules/platform/dotnet/examples/Apache.Ignite.ExamplesDll/Services/MapService.cs
@@ -0,0 +1,119 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+using System;
+using Apache.Ignite.Core;
+using Apache.Ignite.Core.Cache;
+using Apache.Ignite.Core.Resource;
+using Apache.Ignite.Core.Services;
+
+namespace Apache.Ignite.ExamplesDll.Services
+{
+    /// <summary>
+    /// Service implementation.
+    /// </summary>
+    [Serializable]
+    public class MapService<TK, TV> : IService
+    {
+        /** Injected Ignite instance. */
+#pragma warning disable 649
+        [InstanceResource] private readonly IIgnite _ignite;
+#pragma warning restore 649
+
+        /** Cache. */
+        private ICache<TK, TV> _cache;
+
+        /// <summary>
+        /// Initializes this instance before execution.
+        /// </summary>
+        /// <param name="context">Service execution context.</param>
+        public void Init(IServiceContext context)
+        {
+            // Create a new cache for every service deployment.
+            // Note that we use service name as cache name, which allows
+            // for each service deployment to use its own isolated cache.
+            _cache = _ignite.GetOrCreateCache<TK, TV>("MapService_" + context.Name);
+
+            Console.WriteLine("Service initialized: " + context.Name);
+        }
+
+        /// <summary>
+        /// Starts execution of this service. This method is automatically invoked whenever an instance of the service
+        /// is deployed on an Ignite node. Note that service is considered deployed even after it exits the Execute
+        /// method and can be cancelled (or undeployed) only by calling any of the Cancel methods on 
+        /// <see cref="IServices"/> API. Also note that service is not required to exit from Execute method until
+        /// Cancel method was called.
+        /// </summary>
+        /// <param name="context">Service execution context.</param>
+        public void Execute(IServiceContext context)
+        {
+            Console.WriteLine("Service started: " + context.Name);
+        }
+
+        /// <summary>
+        /// Cancels this instance.
+        /// <para/>
+        /// Note that Ignite cannot guarantee that the service exits from <see cref="IService.Execute"/>
+        /// method whenever <see cref="IService.Cancel"/> is called. It is up to the user to
+        /// make sure that the service code properly reacts to cancellations.
+        /// </summary>
+        /// <param name="context">Service execution context.</param>
+        public void Cancel(IServiceContext context)
+        {
+            Console.WriteLine("Service cancelled: " + context.Name);
+        }
+
+        /// <summary>
+        /// Puts an entry to the map.
+        /// </summary>
+        /// <param name="key">The key.</param>
+        /// <param name="value">The value.</param>
+        public void Put(TK key, TV value)
+        {
+            _cache.Put(key, value);
+        }
+
+        /// <summary>
+        /// Gets an entry from the map.
+        /// </summary>
+        /// <param name="key">The key.</param>
+        /// <returns>Entry value.</returns>
+        public TV Get(TK key)
+        {
+            return _cache.Get(key);
+        }
+
+        /// <summary>
+        /// Clears the map.
+        /// </summary>
+        public void Clear()
+        {
+            _cache.Clear();
+        }
+
+        /// <summary>
+        /// Gets the size of the map.
+        /// </summary>
+        /// <value>
+        /// The size.
+        /// </value>
+        public int Size
+        {
+            get { return _cache.GetSize(); }
+        }
+    }
+}

http://git-wip-us.apache.org/repos/asf/ignite/blob/a958801c/modules/platform/dotnet/examples/Config/example-cache-query.xml
----------------------------------------------------------------------
diff --git a/modules/platform/dotnet/examples/Config/example-cache-query.xml b/modules/platform/dotnet/examples/Config/example-cache-query.xml
new file mode 100644
index 0000000..c9ea7e1
--- /dev/null
+++ b/modules/platform/dotnet/examples/Config/example-cache-query.xml
@@ -0,0 +1,111 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!--
+  Licensed to the Apache Software Foundation (ASF) under one or more
+  contributor license agreements.  See the NOTICE file distributed with
+  this work for additional information regarding copyright ownership.
+  The ASF licenses this file to You under the Apache License, Version 2.0
+  (the "License"); you may not use this file except in compliance with
+  the License.  You may obtain a copy of the License at
+
+       http://www.apache.org/licenses/LICENSE-2.0
+
+  Unless required by applicable law or agreed to in writing, software
+  distributed under the License is distributed on an "AS IS" BASIS,
+  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+  See the License for the specific language governing permissions and
+  limitations under the License.
+-->
+
+<beans xmlns="http://www.springframework.org/schema/beans"
+       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+       xmlns:util="http://www.springframework.org/schema/util"
+       xsi:schemaLocation="
+        http://www.springframework.org/schema/beans
+        http://www.springframework.org/schema/beans/spring-beans.xsd
+        http://www.springframework.org/schema/util
+        http://www.springframework.org/schema/util/spring-util.xsd">
+    <bean id="grid.cfg" class="org.apache.ignite.configuration.IgniteConfiguration">
+        
+        <property name="platformConfiguration">
+            <bean class="org.apache.ignite.platform.dotnet.PlatformDotNetConfiguration">
+                <property name="portableConfiguration">
+                    <bean class="org.apache.ignite.platform.dotnet.PlatformDotNetPortableConfiguration">
+                        <property name="types">
+                            <list>
+                                <value>Apache.Ignite.Examples.Dll.Portable.Account</value>
+                                <value>Apache.Ignite.Examples.Dll.Portable.Address</value>
+                                <value>Apache.Ignite.Examples.Dll.Portable.Employee</value>
+                                <value>Apache.Ignite.Examples.Dll.Portable.EmployeeKey</value>
+                                <value>Apache.Ignite.Examples.Dll.Portable.Organization</value>
+                                <value>Apache.Ignite.Examples.Dll.Portable.OrganizationType</value>
+                            </list>
+                        </property>
+                    </bean>
+                </property>
+            </bean>
+        </property>
+
+        <!-- Cache configurations (all properties are optional). -->
+        <property name="cacheConfiguration">
+            <list>
+                <bean class="org.apache.ignite.configuration.CacheConfiguration">
+                    <property name="atomicityMode" value="ATOMIC"/>
+                    <property name="backups" value="1"/>
+
+                    <!-- Configure type metadata to enable queries. -->
+                    <property name="typeMetadata">
+                        <list>
+                            <bean class="org.apache.ignite.cache.CacheTypeMetadata">
+                                <property name="keyType" value="java.lang.Integer"/>
+                                <property name="valueType" value="Organization"/>
+                                <property name="ascendingFields">
+                                    <map>
+                                        <entry key="name" value="java.lang.String"/>
+                                    </map>
+                                </property>
+                            </bean>
+                            <bean class="org.apache.ignite.cache.CacheTypeMetadata">
+                                <property name="keyType" value="EmployeeKey"/>
+                                <property name="valueType" value="Employee"/>
+                                <property name="ascendingFields">
+                                    <map>
+                                        <entry key="organizationId" value="java.lang.Integer"/>
+                                        <entry key="address.zip" value="java.lang.Integer"/>
+                                    </map>
+                                </property>
+                                <property name="queryFields">
+                                    <map>
+                                        <entry key="name" value="java.lang.String"/>
+                                        <entry key="salary" value="java.lang.Long"/>
+                                    </map>
+                                </property>
+                                <property name="textFields">
+                                    <list>
+                                        <value>address.street</value>
+                                    </list>
+                                </property>
+                            </bean>
+                        </list>
+                    </property>
+                </bean>
+            </list>
+        </property>
+
+        <!-- Explicitly configure TCP discovery SPI to provide list of initial nodes. -->
+        <property name="discoverySpi">
+            <bean class="org.apache.ignite.spi.discovery.tcp.TcpDiscoverySpi">
+                <property name="ipFinder">
+                    <bean class="org.apache.ignite.spi.discovery.tcp.ipfinder.multicast.TcpDiscoveryMulticastIpFinder">
+                        <property name="addresses">
+                            <list>
+                                <!-- In distributed environment, replace with actual host IP address. -->
+                                <value>127.0.0.1:47500..47501</value>
+                            </list>
+                        </property>
+                    </bean>
+                </property>
+            </bean>
+        </property>
+    </bean>
+</beans>

http://git-wip-us.apache.org/repos/asf/ignite/blob/a958801c/modules/platform/dotnet/examples/Config/example-cache-store.xml
----------------------------------------------------------------------
diff --git a/modules/platform/dotnet/examples/Config/example-cache-store.xml b/modules/platform/dotnet/examples/Config/example-cache-store.xml
new file mode 100644
index 0000000..adc5f45
--- /dev/null
+++ b/modules/platform/dotnet/examples/Config/example-cache-store.xml
@@ -0,0 +1,60 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!--
+  Licensed to the Apache Software Foundation (ASF) under one or more
+  contributor license agreements.  See the NOTICE file distributed with
+  this work for additional information regarding copyright ownership.
+  The ASF licenses this file to You under the Apache License, Version 2.0
+  (the "License"); you may not use this file except in compliance with
+  the License.  You may obtain a copy of the License at
+
+       http://www.apache.org/licenses/LICENSE-2.0
+
+  Unless required by applicable law or agreed to in writing, software
+  distributed under the License is distributed on an "AS IS" BASIS,
+  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+  See the License for the specific language governing permissions and
+  limitations under the License.
+-->
+
+<beans xmlns="http://www.springframework.org/schema/beans"
+       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+       xmlns:util="http://www.springframework.org/schema/util"
+       xsi:schemaLocation="
+        http://www.springframework.org/schema/beans
+        http://www.springframework.org/schema/beans/spring-beans.xsd
+        http://www.springframework.org/schema/util
+        http://www.springframework.org/schema/util/spring-util.xsd">
+    <bean id="grid.cfg" class="org.apache.ignite.configuration.IgniteConfiguration">
+        <property name="cacheConfiguration">
+            <list>
+                <bean class="org.apache.ignite.configuration.CacheConfiguration">
+                    <property name="writeThrough" value="true"/>
+                    <property name="readThrough" value="true"/>
+                    <property name="cacheStoreFactory">
+                        <bean class="org.apache.ignite.platform.dotnet.PlatformDotNetCacheStoreFactory">
+                            <property name="assemblyName" value="Apache.Ignite.ExamplesDll"/>
+                            <property name="className" value="Apache.Ignite.ExamplesDll.Datagrid.EmployeeStore"/>
+                        </bean>
+                    </property>
+                </bean>
+            </list>
+        </property>
+
+        <!-- Explicitly configure TCP discovery SPI to provide list of initial nodes. -->
+        <property name="discoverySpi">
+            <bean class="org.apache.ignite.spi.discovery.tcp.TcpDiscoverySpi">
+                <property name="ipFinder">
+                    <bean class="org.apache.ignite.spi.discovery.tcp.ipfinder.multicast.TcpDiscoveryMulticastIpFinder">
+                        <property name="addresses">
+                            <list>
+                                <!-- In distributed environment, replace with actual host IP address. -->
+                                <value>127.0.0.1:47500..47501</value>
+                            </list>
+                        </property>
+                    </bean>
+                </property>
+            </bean>
+        </property>
+    </bean>
+</beans>

http://git-wip-us.apache.org/repos/asf/ignite/blob/a958801c/modules/platform/dotnet/examples/Config/example-cache.xml
----------------------------------------------------------------------
diff --git a/modules/platform/dotnet/examples/Config/example-cache.xml b/modules/platform/dotnet/examples/Config/example-cache.xml
new file mode 100644
index 0000000..a262ce1
--- /dev/null
+++ b/modules/platform/dotnet/examples/Config/example-cache.xml
@@ -0,0 +1,83 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!--
+  Licensed to the Apache Software Foundation (ASF) under one or more
+  contributor license agreements.  See the NOTICE file distributed with
+  this work for additional information regarding copyright ownership.
+  The ASF licenses this file to You under the Apache License, Version 2.0
+  (the "License"); you may not use this file except in compliance with
+  the License.  You may obtain a copy of the License at
+
+       http://www.apache.org/licenses/LICENSE-2.0
+
+  Unless required by applicable law or agreed to in writing, software
+  distributed under the License is distributed on an "AS IS" BASIS,
+  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+  See the License for the specific language governing permissions and
+  limitations under the License.
+-->
+
+<beans xmlns="http://www.springframework.org/schema/beans"
+       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+       xmlns:util="http://www.springframework.org/schema/util"
+       xsi:schemaLocation="
+        http://www.springframework.org/schema/beans
+        http://www.springframework.org/schema/beans/spring-beans.xsd
+        http://www.springframework.org/schema/util
+        http://www.springframework.org/schema/util/spring-util.xsd">
+    <bean id="grid.cfg" class="org.apache.ignite.configuration.IgniteConfiguration">
+        <!-- Set to true to enable distributed class loading for examples, default is false. -->
+        <property name="peerClassLoadingEnabled" value="true"/>
+
+        <property name="platformConfiguration">
+            <bean class="org.apache.ignite.platform.dotnet.PlatformDotNetConfiguration">
+                <property name="portableConfiguration">
+                    <bean class="org.apache.ignite.platform.dotnet.PlatformDotNetPortableConfiguration">
+                        <property name="types">
+                            <list>
+                                <value>Apache.Ignite.Examples.Dll.Portable.Account</value>
+                                <value>Apache.Ignite.Examples.Dll.Portable.Address</value>
+                                <value>Apache.Ignite.Examples.Dll.Portable.Employee</value>
+                                <value>Apache.Ignite.Examples.Dll.Portable.EmployeeKey</value>
+                                <value>Apache.Ignite.Examples.Dll.Portable.Organization</value>
+                                <value>Apache.Ignite.Examples.Dll.Portable.OrganizationType</value>
+                            </list>
+                        </property>
+                    </bean>
+                </property>
+            </bean>
+        </property>
+
+        <property name="cacheConfiguration">
+            <list>
+                <bean class="org.apache.ignite.configuration.CacheConfiguration">
+                    <property name="name" value="cache*"/>
+                    <property name="atomicityMode" value="ATOMIC"/>
+                    <property name="backups" value="1"/>
+                </bean>
+
+                <bean class="org.apache.ignite.configuration.CacheConfiguration">
+                    <property name="name" value="tx"/>
+                    <property name="atomicityMode" value="TRANSACTIONAL"/>
+                    <property name="backups" value="1"/>
+                </bean>
+            </list>
+        </property>
+
+        <!-- Explicitly configure TCP discovery SPI to provide list of initial nodes. -->
+        <property name="discoverySpi">
+            <bean class="org.apache.ignite.spi.discovery.tcp.TcpDiscoverySpi">
+                <property name="ipFinder">
+                    <bean class="org.apache.ignite.spi.discovery.tcp.ipfinder.multicast.TcpDiscoveryMulticastIpFinder">
+                        <property name="addresses">
+                            <list>
+                                <!-- In distributed environment, replace with actual host IP address. -->
+                                <value>127.0.0.1:47500..47501</value>
+                            </list>
+                        </property>
+                    </bean>
+                </property>
+            </bean>
+        </property>
+    </bean>
+</beans>

http://git-wip-us.apache.org/repos/asf/ignite/blob/a958801c/modules/platform/dotnet/examples/Config/example-compute.xml
----------------------------------------------------------------------
diff --git a/modules/platform/dotnet/examples/Config/example-compute.xml b/modules/platform/dotnet/examples/Config/example-compute.xml
new file mode 100644
index 0000000..bbc6550
--- /dev/null
+++ b/modules/platform/dotnet/examples/Config/example-compute.xml
@@ -0,0 +1,70 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!--
+  Licensed to the Apache Software Foundation (ASF) under one or more
+  contributor license agreements.  See the NOTICE file distributed with
+  this work for additional information regarding copyright ownership.
+  The ASF licenses this file to You under the Apache License, Version 2.0
+  (the "License"); you may not use this file except in compliance with
+  the License.  You may obtain a copy of the License at
+
+       http://www.apache.org/licenses/LICENSE-2.0
+
+  Unless required by applicable law or agreed to in writing, software
+  distributed under the License is distributed on an "AS IS" BASIS,
+  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+  See the License for the specific language governing permissions and
+  limitations under the License.
+-->
+
+<beans xmlns="http://www.springframework.org/schema/beans"
+       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+       xmlns:util="http://www.springframework.org/schema/util"
+       xsi:schemaLocation="
+        http://www.springframework.org/schema/beans
+        http://www.springframework.org/schema/beans/spring-beans.xsd
+        http://www.springframework.org/schema/util
+        http://www.springframework.org/schema/util/spring-util.xsd">
+    <bean id="grid.cfg" class="org.apache.ignite.configuration.IgniteConfiguration">
+        <!-- Explicitly configure TCP discovery SPI to provide list of initial nodes. -->
+        <property name="discoverySpi">
+            <bean class="org.apache.ignite.spi.discovery.tcp.TcpDiscoverySpi">
+                <property name="ipFinder">
+                    <bean class="org.apache.ignite.spi.discovery.tcp.ipfinder.multicast.TcpDiscoveryMulticastIpFinder">
+                        <property name="addresses">
+                            <list>
+                                <!-- In distributed environment, replace with actual host IP address. -->
+                                <value>127.0.0.1:47500..47501</value>
+                            </list>
+                        </property>
+                    </bean>
+                </property>
+            </bean>
+        </property>
+		
+        <!-- Enable task execution events for examples. -->
+        <property name="includeEventTypes">
+            <list>
+                <!-- Task execution events -->
+                <util:constant static-field="org.apache.ignite.events.EventType.EVT_TASK_STARTED"/>
+                <util:constant static-field="org.apache.ignite.events.EventType.EVT_TASK_FINISHED"/>
+                <util:constant static-field="org.apache.ignite.events.EventType.EVT_TASK_FAILED"/>
+                <util:constant static-field="org.apache.ignite.events.EventType.EVT_TASK_TIMEDOUT"/>
+                <util:constant static-field="org.apache.ignite.events.EventType.EVT_TASK_SESSION_ATTR_SET"/>
+                <util:constant static-field="org.apache.ignite.events.EventType.EVT_TASK_REDUCED"/>
+                
+                <!-- Job execution events -->
+                <util:constant static-field="org.apache.ignite.events.EventType.EVT_JOB_MAPPED"/>
+                <util:constant static-field="org.apache.ignite.events.EventType.EVT_JOB_RESULTED"/>
+                <util:constant static-field="org.apache.ignite.events.EventType.EVT_JOB_FAILED_OVER"/>
+                <util:constant static-field="org.apache.ignite.events.EventType.EVT_JOB_STARTED"/>
+                <util:constant static-field="org.apache.ignite.events.EventType.EVT_JOB_FINISHED"/>
+                <util:constant static-field="org.apache.ignite.events.EventType.EVT_JOB_TIMEDOUT"/>
+                <util:constant static-field="org.apache.ignite.events.EventType.EVT_JOB_REJECTED"/>
+                <util:constant static-field="org.apache.ignite.events.EventType.EVT_JOB_FAILED"/>
+                <util:constant static-field="org.apache.ignite.events.EventType.EVT_JOB_QUEUED"/>
+                <util:constant static-field="org.apache.ignite.events.EventType.EVT_JOB_CANCELLED"/>
+            </list>
+        </property>		
+    </bean>
+</beans>

http://git-wip-us.apache.org/repos/asf/ignite/blob/a958801c/modules/platform/dotnet/examples/README.txt
----------------------------------------------------------------------
diff --git a/modules/platform/dotnet/examples/README.txt b/modules/platform/dotnet/examples/README.txt
new file mode 100644
index 0000000..c49dc5a
--- /dev/null
+++ b/modules/platform/dotnet/examples/README.txt
@@ -0,0 +1,14 @@
+Apache Ignite .Net Examples
+==================================
+
+Common requirements
+----------------------------------
+ * Apache Ignite .Net library must be built using instructions from %IGNITE_HOME%\platforms\dotnet\README.txt.
+
+
+Running examples
+----------------------------------
+
+ * Open Visual Studio solution %IGNITE_HOME%\platforms\dotnet\examples\Apache.Ignite.Examples.sln
+ * Build Apache.Ignite.ExamplesDll project.
+ * Set desired example as startup object in Apache.Ignite.Examples project and run it.
\ No newline at end of file