ignite-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From voze...@apache.org
Subject ignite git commit: IGNITE-1768 .Net: Review portable configuration on Java side - remove AssemblyName.
Date Fri, 30 Oct 2015 12:34:17 GMT
Repository: ignite
Updated Branches:
  refs/heads/ignite-1282 b85fa1714 -> bcb237ae2


IGNITE-1768 .Net: Review portable configuration on Java side - remove AssemblyName.


Project: http://git-wip-us.apache.org/repos/asf/ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/bcb237ae
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/bcb237ae
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/bcb237ae

Branch: refs/heads/ignite-1282
Commit: bcb237ae21add57c15d19d9f1cf656258f597e39
Parents: b85fa17
Author: Pavel Tupitsyn <ptupitsyn@gridgain.com>
Authored: Fri Oct 30 15:35:00 2015 +0300
Committer: vozerov-gridgain <vozerov@gridgain.com>
Committed: Fri Oct 30 15:35:00 2015 +0300

----------------------------------------------------------------------
 .../dotnet/PlatformDotNetCacheStore.java        | 53 +++++++----------
 .../PlatformDotNetConfigurationClosure.java     |  3 +-
 .../platform/utils/PlatformUtils.java           |  1 -
 .../dotnet/PlatformDotNetCacheStoreFactory.java | 44 ++++----------
 .../dotnet/PlatformDotNetLifecycleBean.java     | 49 ++++------------
 ...PlatformDotNetPortableTypeConfiguration.java | 18 ------
 .../Config/Cache/Store/cache-store-session.xml  |  3 +-
 .../Config/Lifecycle/lifecycle-beans.xml        |  4 +-
 .../native-client-test-cache-parallel-store.xml |  3 +-
 .../Config/native-client-test-cache-store.xml   | 12 ++--
 .../dotnet/Apache.Ignite.Core/Ignition.cs       |  7 +--
 .../Impl/Cache/Store/CacheStore.cs              |  3 +-
 .../Apache.Ignite.Core/Impl/IgniteUtils.cs      | 14 ++---
 .../Impl/Portable/PortableMarshaller.cs         |  5 +-
 .../Impl/Portable/PortableUtils.cs              | 48 ++++++---------
 .../Portable/PortableTypeConfiguration.cs       | 62 ++++----------------
 modules/platforms/dotnet/Apache.Ignite.sln      |  4 ++
 .../examples/Config/example-cache-store.xml     |  3 +-
 18 files changed, 99 insertions(+), 237 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/bcb237ae/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/dotnet/PlatformDotNetCacheStore.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/dotnet/PlatformDotNetCacheStore.java
b/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/dotnet/PlatformDotNetCacheStore.java
index c86de5d..0c2e564 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/dotnet/PlatformDotNetCacheStore.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/dotnet/PlatformDotNetCacheStore.java
@@ -96,11 +96,8 @@ public class PlatformDotNetCacheStore<K, V> implements CacheStore<K,
V>, Platfor
     @CacheStoreSessionResource
     private CacheStoreSession ses;
 
-    /** .Net assembly name. */
-    private String assemblyName;
-
     /** .Net class name. */
-    private String clsName;
+    private String typName;
 
     /** Properties. */
     private Map<String, ?> props;
@@ -112,39 +109,21 @@ public class PlatformDotNetCacheStore<K, V> implements CacheStore<K,
V>, Platfor
     protected long ptr;
 
     /**
-     * Gets .NET assembly name.
-     *
-     * @return .NET assembly name.
-     */
-    public String getAssemblyName() {
-        return assemblyName;
-    }
-
-    /**
-     * Set .NET assembly name.
-     *
-     * @param assemblyName .NET assembly name.
-     */
-    public void setAssemblyName(String assemblyName) {
-        this.assemblyName = assemblyName;
-    }
-
-    /**
      * Gets .NET class name.
      *
      * @return .NET class name.
      */
-    public String getClassName() {
-        return clsName;
+    public String getTypeName() {
+        return typName;
     }
 
     /**
      * Sets .NET class name.
      *
-     * @param clsName .NET class name.
+     * @param typName .NET class name.
      */
-    public void setClassName(String clsName) {
-        this.clsName = clsName;
+    public void setTypeName(String typName) {
+        this.typName = typName;
     }
 
     /**
@@ -343,8 +322,7 @@ public class PlatformDotNetCacheStore<K, V> implements CacheStore<K,
V>, Platfor
      * @throws org.apache.ignite.IgniteCheckedException
      */
     public void initialize(GridKernalContext ctx, boolean convertPortable) throws IgniteCheckedException
{
-        A.notNull(assemblyName, "assemblyName");
-        A.notNull(clsName, "clsName");
+        A.notNull(typName, "typName");
 
         platformCtx = PlatformUtils.platformContext(ctx.grid());
 
@@ -353,10 +331,7 @@ public class PlatformDotNetCacheStore<K, V> implements CacheStore<K,
V>, Platfor
 
             PortableRawWriterEx writer = platformCtx.writer(out);
 
-            writer.writeString(assemblyName);
-            writer.writeString(clsName);
-            writer.writeBoolean(convertPortable);
-            writer.writeMap(props);
+            write(writer, convertPortable);
 
             out.synchronize();
 
@@ -365,6 +340,18 @@ public class PlatformDotNetCacheStore<K, V> implements CacheStore<K,
V>, Platfor
     }
 
     /**
+     * Write store data to a stream.
+     *
+     * @param writer Writer.
+     * @param convertPortable Convert portable flag.
+     */
+    protected void write(PortableRawWriterEx writer, boolean convertPortable) {
+        writer.writeString(typName);
+        writer.writeBoolean(convertPortable);
+        writer.writeMap(props);
+    }
+
+    /**
      * Gets session pointer created in native platform.
      *
      * @return Session pointer.

http://git-wip-us.apache.org/repos/asf/ignite/blob/bcb237ae/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/dotnet/PlatformDotNetConfigurationClosure.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/dotnet/PlatformDotNetConfigurationClosure.java
b/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/dotnet/PlatformDotNetConfigurationClosure.java
index 35d2df4..2c8664c 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/dotnet/PlatformDotNetConfigurationClosure.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/dotnet/PlatformDotNetConfigurationClosure.java
@@ -146,8 +146,7 @@ public class PlatformDotNetConfigurationClosure extends PlatformAbstractConfigur
                 writer.writeInt(beans.size());
 
                 for (PlatformDotNetLifecycleBean bean : beans) {
-                    writer.writeString(bean.getAssemblyName());
-                    writer.writeString(bean.getClassName());
+                    writer.writeString(bean.getTypeName());
                     writer.writeMap(bean.getProperties());
                 }
 

http://git-wip-us.apache.org/repos/asf/ignite/blob/bcb237ae/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/utils/PlatformUtils.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/utils/PlatformUtils.java
b/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/utils/PlatformUtils.java
index 11d8371..66c51e5 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/utils/PlatformUtils.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/utils/PlatformUtils.java
@@ -781,7 +781,6 @@ public class PlatformUtils {
             writeNullableCollection(writer, portableCfg.getTypesConfiguration(),
                 new PlatformWriterClosure<PlatformDotNetPortableTypeConfiguration>()
{
                 @Override public void write(PortableRawWriterEx writer, PlatformDotNetPortableTypeConfiguration
typ) {
-                    writer.writeString(typ.getAssemblyName());
                     writer.writeString(typ.getTypeName());
                     writer.writeString(typ.getNameMapper());
                     writer.writeString(typ.getIdMapper());

http://git-wip-us.apache.org/repos/asf/ignite/blob/bcb237ae/modules/core/src/main/java/org/apache/ignite/platform/dotnet/PlatformDotNetCacheStoreFactory.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/platform/dotnet/PlatformDotNetCacheStoreFactory.java
b/modules/core/src/main/java/org/apache/ignite/platform/dotnet/PlatformDotNetCacheStoreFactory.java
index 97f0dce..55de4bc 100644
--- a/modules/core/src/main/java/org/apache/ignite/platform/dotnet/PlatformDotNetCacheStoreFactory.java
+++ b/modules/core/src/main/java/org/apache/ignite/platform/dotnet/PlatformDotNetCacheStoreFactory.java
@@ -55,11 +55,8 @@ public class PlatformDotNetCacheStoreFactory implements Factory<PlatformDotNetCa
     /** */
     private static final long serialVersionUID = 0L;
 
-    /** .Net assembly name. */
-    private String assemblyName;
-
-    /** .Net class name. */
-    private String clsName;
+    /** .Net type name. */
+    private String typName;
 
     /** Properties. */
     private Map<String, ?> props;
@@ -68,39 +65,21 @@ public class PlatformDotNetCacheStoreFactory implements Factory<PlatformDotNetCa
     private transient PlatformDotNetCacheStore instance;
 
     /**
-     * Gets .NET assembly name.
-     *
-     * @return .NET assembly name.
-     */
-    public String getAssemblyName() {
-        return assemblyName;
-    }
-
-    /**
-     * Set .NET assembly name.
-     *
-     * @param assemblyName .NET assembly name.
-     */
-    public void setAssemblyName(String assemblyName) {
-        this.assemblyName = assemblyName;
-    }
-
-    /**
-     * Gets .NET class name.
+     * Gets .NET type name.
      *
-     * @return .NET class name.
+     * @return .NET type name.
      */
-    public String getClassName() {
-        return clsName;
+    public String getTypeName() {
+        return typName;
     }
 
     /**
-     * Sets .NET class name.
+     * Sets .NET type name.
      *
-     * @param clsName .NET class name.
+     * @param typName .NET type name.
      */
-    public void setClassName(String clsName) {
-        this.clsName = clsName;
+    public void setTypeName(String typName) {
+        this.typName = typName;
     }
 
     /**
@@ -128,8 +107,7 @@ public class PlatformDotNetCacheStoreFactory implements Factory<PlatformDotNetCa
             if (instance == null) {
                 instance = new PlatformDotNetCacheStore();
 
-                instance.setAssemblyName(assemblyName);
-                instance.setClassName(clsName);
+                instance.setTypeName(typName);
                 instance.setProperties(props);
             }
 

http://git-wip-us.apache.org/repos/asf/ignite/blob/bcb237ae/modules/core/src/main/java/org/apache/ignite/platform/dotnet/PlatformDotNetLifecycleBean.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/platform/dotnet/PlatformDotNetLifecycleBean.java
b/modules/core/src/main/java/org/apache/ignite/platform/dotnet/PlatformDotNetLifecycleBean.java
index 8e4b590..7c286a9 100644
--- a/modules/core/src/main/java/org/apache/ignite/platform/dotnet/PlatformDotNetLifecycleBean.java
+++ b/modules/core/src/main/java/org/apache/ignite/platform/dotnet/PlatformDotNetLifecycleBean.java
@@ -26,11 +26,8 @@ import java.util.Map;
  * Lifecycle bean implementation which can be used to configure .Net lifecycle beans in Java
Spring configuration.
  */
 public class PlatformDotNetLifecycleBean extends PlatformLifecycleBean implements LifecycleBean
{
-    /** Assembly name. */
-    private String assemblyName;
-
-    /** Class name. */
-    private String clsName;
+    /** Type name. */
+    private String typName;
 
     /** Properties. */
     private Map<String, ?> props;
@@ -45,48 +42,28 @@ public class PlatformDotNetLifecycleBean extends PlatformLifecycleBean
implement
     /**
      * Constructor.
      *
-     * @param assemblyName Assembly name.
-     * @param clsName Class name.
-     */
-    public PlatformDotNetLifecycleBean(String assemblyName, String clsName) {
-        this.assemblyName = assemblyName;
-        this.clsName = clsName;
-    }
-
-    /**
-     * Get assembly name.
-     *
-     * @return Assembly name.
-     */
-    public String getAssemblyName() {
-        return assemblyName;
-    }
-
-    /**
-     * Set assembly name.
-     *
-     * @param assemblyName Assembly name.
+     * @param typName Type name.
      */
-    public void setAssemblyName(String assemblyName) {
-        this.assemblyName = assemblyName;
+    public PlatformDotNetLifecycleBean(String typName) {
+        this.typName = typName;
     }
 
     /**
-     * Get class name.
+     * Get type name.
      *
-     * @return Class name.
+     * @return Type name.
      */
-    public String getClassName() {
-        return clsName;
+    public String getTypeName() {
+        return typName;
     }
 
     /**
-     * Set class name.
+     * Set type name.
      *
-     * @param clsName Class name.
+     * @param typName Type name.
      */
-    public void setClassName(String clsName) {
-        this.clsName = clsName;
+    public void setTypeName(String typName) {
+        this.typName = typName;
     }
 
     /**

http://git-wip-us.apache.org/repos/asf/ignite/blob/bcb237ae/modules/core/src/main/java/org/apache/ignite/platform/dotnet/PlatformDotNetPortableTypeConfiguration.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/platform/dotnet/PlatformDotNetPortableTypeConfiguration.java
b/modules/core/src/main/java/org/apache/ignite/platform/dotnet/PlatformDotNetPortableTypeConfiguration.java
index b04d2a7..cb00a74 100644
--- a/modules/core/src/main/java/org/apache/ignite/platform/dotnet/PlatformDotNetPortableTypeConfiguration.java
+++ b/modules/core/src/main/java/org/apache/ignite/platform/dotnet/PlatformDotNetPortableTypeConfiguration.java
@@ -24,9 +24,6 @@ import org.jetbrains.annotations.Nullable;
  * Mirror of .Net class GridDotNetPortableTypeConfiguration.cs
  */
 public class PlatformDotNetPortableTypeConfiguration {
-    /** Assembly name. */
-    private String assemblyName;
-
     /** Type name. */
     private String typeName;
 
@@ -60,7 +57,6 @@ public class PlatformDotNetPortableTypeConfiguration {
      * @param cfg configuration to copy.
      */
     public PlatformDotNetPortableTypeConfiguration(PlatformDotNetPortableTypeConfiguration
cfg) {
-        assemblyName = cfg.getAssemblyName();
         typeName = cfg.getTypeName();
         nameMapper = cfg.getNameMapper();
         idMapper = cfg.getIdMapper();
@@ -71,20 +67,6 @@ public class PlatformDotNetPortableTypeConfiguration {
     }
 
     /**
-     * @return Assembly name.
-     */
-    public String getAssemblyName() {
-        return assemblyName;
-    }
-
-    /**
-     * @param assemblyName New assembly name.
-     */
-    public void setAssemblyName(String assemblyName) {
-        this.assemblyName = assemblyName;
-    }
-
-    /**
      * @return Type name.
      */
     public String getTypeName() {

http://git-wip-us.apache.org/repos/asf/ignite/blob/bcb237ae/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Config/Cache/Store/cache-store-session.xml
----------------------------------------------------------------------
diff --git a/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Config/Cache/Store/cache-store-session.xml
b/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Config/Cache/Store/cache-store-session.xml
index 00837a9..66d4114 100644
--- a/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Config/Cache/Store/cache-store-session.xml
+++ b/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Config/Cache/Store/cache-store-session.xml
@@ -26,8 +26,7 @@
         http://www.springframework.org/schema/util
         http://www.springframework.org/schema/util/spring-util.xsd">
     <bean id="storeFactory" class="org.apache.ignite.platform.dotnet.PlatformDotNetCacheStoreFactory">
-        <property name="assemblyName" value="Apache.Ignite.Core.Tests"/>
-        <property name="className" value="Apache.Ignite.Core.Tests.Cache.Store.CacheStoreSessionTest+Store"/>
+        <property name="typeName" value="Apache.Ignite.Core.Tests.Cache.Store.CacheStoreSessionTest+Store,
Apache.Ignite.Core.Tests"/>
     </bean>
   
     <bean id="grid.cfg" class="org.apache.ignite.configuration.IgniteConfiguration">

http://git-wip-us.apache.org/repos/asf/ignite/blob/bcb237ae/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Config/Lifecycle/lifecycle-beans.xml
----------------------------------------------------------------------
diff --git a/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Config/Lifecycle/lifecycle-beans.xml
b/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Config/Lifecycle/lifecycle-beans.xml
index da36032..a40c27c 100644
--- a/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Config/Lifecycle/lifecycle-beans.xml
+++ b/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Config/Lifecycle/lifecycle-beans.xml
@@ -45,11 +45,11 @@
             <list>
                 <bean class="org.apache.ignite.platform.lifecycle.PlatformJavaLifecycleBean"
/>
                 <bean class="org.apache.ignite.platform.dotnet.PlatformDotNetLifecycleBean">
-                    <property name="className" value="Apache.Ignite.Core.Tests.Bean" />
+                    <property name="typeName" value="Apache.Ignite.Core.Tests.Bean" />
                 </bean>
                 <bean class="org.apache.ignite.platform.lifecycle.PlatformJavaLifecycleBean"
/>
                 <bean class="org.apache.ignite.platform.dotnet.PlatformDotNetLifecycleBean">
-                    <property name="className" value="Apache.Ignite.Core.Tests.Bean" />
+                    <property name="typeName" value="Apache.Ignite.Core.Tests.Bean" />
                     <property name="properties">
                         <map>
                             <entry key="Property1">

http://git-wip-us.apache.org/repos/asf/ignite/blob/bcb237ae/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Config/native-client-test-cache-parallel-store.xml
----------------------------------------------------------------------
diff --git a/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Config/native-client-test-cache-parallel-store.xml
b/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Config/native-client-test-cache-parallel-store.xml
index 00e8e45..74abbf8 100644
--- a/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Config/native-client-test-cache-parallel-store.xml
+++ b/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Config/native-client-test-cache-parallel-store.xml
@@ -43,8 +43,7 @@
 
                     <property name="cacheStoreFactory">
                         <bean class="org.apache.ignite.platform.dotnet.PlatformDotNetCacheStoreFactory">
-                            <property name="assemblyName" value="Apache.Ignite.Core.Tests"/>
-                            <property name="className" value="Apache.Ignite.Core.Tests.Cache.Store.CacheTestParallelLoadStore"/>
+                            <property name="typeName" value="Apache.Ignite.Core.Tests.Cache.Store.CacheTestParallelLoadStore,
Apache.Ignite.Core.Tests"/>
                         </bean>
                     </property>
                 </bean>

http://git-wip-us.apache.org/repos/asf/ignite/blob/bcb237ae/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Config/native-client-test-cache-store.xml
----------------------------------------------------------------------
diff --git a/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Config/native-client-test-cache-store.xml
b/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Config/native-client-test-cache-store.xml
index 9af4611..6845a3c 100644
--- a/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Config/native-client-test-cache-store.xml
+++ b/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Config/native-client-test-cache-store.xml
@@ -44,8 +44,7 @@
 
                     <property name="cacheStoreFactory">
                         <bean class="org.apache.ignite.platform.dotnet.PlatformDotNetCacheStoreFactory">
-                            <property name="assemblyName" value="Apache.Ignite.Core.Tests"/>
-                            <property name="className" value="Apache.Ignite.Core.Tests.Cache.Store.CacheTestStore"/>
+                            <property name="typeName" value="Apache.Ignite.Core.Tests.Cache.Store.CacheTestStore,
Apache.Ignite.Core.Tests"/>
                         </bean>
                     </property>
                 </bean>
@@ -60,8 +59,7 @@
 
                     <property name="cacheStoreFactory">
                         <bean class="org.apache.ignite.platform.dotnet.PlatformDotNetCacheStoreFactory">
-                            <property name="assemblyName" value="Apache.Ignite.Core.Tests"/>
-                            <property name="className" value="Apache.Ignite.Core.Tests.Cache.Store.CacheTestStore"/>
+                            <property name="typeName" value="Apache.Ignite.Core.Tests.Cache.Store.CacheTestStore,
Apache.Ignite.Core.Tests"/>
                         </bean>
                     </property>
                 </bean>
@@ -76,8 +74,7 @@
 
                     <property name="cacheStoreFactory">
                         <bean class="org.apache.ignite.platform.dotnet.PlatformDotNetCacheStoreFactory">
-                            <property name="assemblyName" value="Apache.Ignite.Core.Tests"/>
-                            <property name="className" value="Apache.Ignite.Core.Tests.Cache.Store.CacheTestStore"/>
+                            <property name="typeName" value="Apache.Ignite.Core.Tests.Cache.Store.CacheTestStore,
Apache.Ignite.Core.Tests"/>
                         </bean>
                     </property>
                 </bean>
@@ -91,8 +88,7 @@
                     
                     <property name="cacheStoreFactory">
                         <bean class="org.apache.ignite.platform.dotnet.PlatformDotNetCacheStoreFactory">
-                            <property name="assemblyName" value="Apache.Ignite.Core.Tests"/>
-                            <property name="className" value="Apache.Ignite.Core.Tests.Cache.Store.CacheTestStore"/>
+                            <property name="typeName" value="Apache.Ignite.Core.Tests.Cache.Store.CacheTestStore,
Apache.Ignite.Core.Tests"/>
                             <property name="properties">
                                 <map>
                                     <entry key="IntProperty">

http://git-wip-us.apache.org/repos/asf/ignite/blob/bcb237ae/modules/platforms/dotnet/Apache.Ignite.Core/Ignition.cs
----------------------------------------------------------------------
diff --git a/modules/platforms/dotnet/Apache.Ignite.Core/Ignition.cs b/modules/platforms/dotnet/Apache.Ignite.Core/Ignition.cs
index 6547c2b..214fcd6 100644
--- a/modules/platforms/dotnet/Apache.Ignite.Core/Ignition.cs
+++ b/modules/platforms/dotnet/Apache.Ignite.Core/Ignition.cs
@@ -338,17 +338,14 @@ namespace Apache.Ignite.Core
         private static ILifecycleBean CreateLifecycleBean(PortableReaderImpl reader)
         {
             // 1. Instantiate.
-            string assemblyName = reader.ReadString();
-            string clsName = reader.ReadString();
-
-            object bean = IgniteUtils.CreateInstance(assemblyName, clsName);
+            var bean = IgniteUtils.CreateInstance<ILifecycleBean>(reader.ReadString());
 
             // 2. Set properties.
             var props = reader.ReadDictionaryAsGeneric<string, object>();
 
             IgniteUtils.SetProperties(bean, props);
 
-            return bean as ILifecycleBean;
+            return bean;
         }
 
         /// <summary>

http://git-wip-us.apache.org/repos/asf/ignite/blob/bcb237ae/modules/platforms/dotnet/Apache.Ignite.Core/Impl/Cache/Store/CacheStore.cs
----------------------------------------------------------------------
diff --git a/modules/platforms/dotnet/Apache.Ignite.Core/Impl/Cache/Store/CacheStore.cs b/modules/platforms/dotnet/Apache.Ignite.Core/Impl/Cache/Store/CacheStore.cs
index 1eeb3a0..59f2264 100644
--- a/modules/platforms/dotnet/Apache.Ignite.Core/Impl/Cache/Store/CacheStore.cs
+++ b/modules/platforms/dotnet/Apache.Ignite.Core/Impl/Cache/Store/CacheStore.cs
@@ -103,12 +103,11 @@ namespace Apache.Ignite.Core.Impl.Cache.Store
             {
                 var reader = PortableUtils.Marshaller.StartUnmarshal(stream, PortableMode.KeepPortable);
 
-                var assemblyName = reader.ReadString();
                 var className = reader.ReadString();
                 var convertPortable = reader.ReadBoolean();
                 var propertyMap = reader.ReadDictionaryAsGeneric<string, object>();
 
-                var store = (ICacheStore) IgniteUtils.CreateInstance(assemblyName, className);
+                var store = IgniteUtils.CreateInstance<ICacheStore>(className);
 
                 IgniteUtils.SetProperties(store, propertyMap);
 

http://git-wip-us.apache.org/repos/asf/ignite/blob/bcb237ae/modules/platforms/dotnet/Apache.Ignite.Core/Impl/IgniteUtils.cs
----------------------------------------------------------------------
diff --git a/modules/platforms/dotnet/Apache.Ignite.Core/Impl/IgniteUtils.cs b/modules/platforms/dotnet/Apache.Ignite.Core/Impl/IgniteUtils.cs
index 532c19d..47ab166 100644
--- a/modules/platforms/dotnet/Apache.Ignite.Core/Impl/IgniteUtils.cs
+++ b/modules/platforms/dotnet/Apache.Ignite.Core/Impl/IgniteUtils.cs
@@ -126,20 +126,18 @@ namespace Apache.Ignite.Core.Impl
         /// <summary>
         /// Create new instance of specified class.
         /// </summary>
-        /// <param name="assemblyName">Assembly name.</param>
-        /// <param name="clsName">Class name</param>
+        /// <param name="typeName">Class name</param>
         /// <returns>New Instance.</returns>
-        public static object CreateInstance(string assemblyName, string clsName)
+        public static T CreateInstance<T>(string typeName)
         {
-            IgniteArgumentCheck.NotNullOrEmpty(clsName, "clsName");
+            IgniteArgumentCheck.NotNullOrEmpty(typeName, "typeName");
 
-            var type = new TypeResolver().ResolveType(clsName, assemblyName);
+            var type = new TypeResolver().ResolveType(typeName);
 
             if (type == null)
-                throw new IgniteException("Failed to create class instance [assemblyName="
+ assemblyName +
-                    ", className=" + clsName + ']');
+                throw new IgniteException("Failed to create class instance [className=" +
typeName + ']');
 
-            return Activator.CreateInstance(type);
+            return (T) Activator.CreateInstance(type);
         }
 
         /// <summary>

http://git-wip-us.apache.org/repos/asf/ignite/blob/bcb237ae/modules/platforms/dotnet/Apache.Ignite.Core/Impl/Portable/PortableMarshaller.cs
----------------------------------------------------------------------
diff --git a/modules/platforms/dotnet/Apache.Ignite.Core/Impl/Portable/PortableMarshaller.cs
b/modules/platforms/dotnet/Apache.Ignite.Core/Impl/Portable/PortableMarshaller.cs
index 5ea7a55..86bf3bb 100644
--- a/modules/platforms/dotnet/Apache.Ignite.Core/Impl/Portable/PortableMarshaller.cs
+++ b/modules/platforms/dotnet/Apache.Ignite.Core/Impl/Portable/PortableMarshaller.cs
@@ -72,9 +72,6 @@ namespace Apache.Ignite.Core.Impl.Portable
             {
                 if (string.IsNullOrEmpty(typeCfg.TypeName))
                     throw new PortableException("Type name cannot be null or empty: " + typeCfg);
-
-                if (typeCfg.AssemblyName != null && typeCfg.AssemblyName.Length ==
0)
-                    throw new PortableException("Assembly name cannot be empty string: "
+ typeCfg);
             }
 
             // Define system types. They use internal reflective stuff, so configuration
doesn't affect them.
@@ -397,7 +394,7 @@ namespace Apache.Ignite.Core.Impl.Portable
             bool keepDeserialized = typeCfg.KeepDeserialized ?? cfg.DefaultKeepDeserialized;
 
             // Try resolving type.
-            Type type = typeResolver.ResolveType(typeCfg.TypeName, typeCfg.AssemblyName);
+            Type type = typeResolver.ResolveType(typeCfg.TypeName);
 
             if (type != null)
             {

http://git-wip-us.apache.org/repos/asf/ignite/blob/bcb237ae/modules/platforms/dotnet/Apache.Ignite.Core/Impl/Portable/PortableUtils.cs
----------------------------------------------------------------------
diff --git a/modules/platforms/dotnet/Apache.Ignite.Core/Impl/Portable/PortableUtils.cs b/modules/platforms/dotnet/Apache.Ignite.Core/Impl/Portable/PortableUtils.cs
index 7f9569a..a0657b2 100644
--- a/modules/platforms/dotnet/Apache.Ignite.Core/Impl/Portable/PortableUtils.cs
+++ b/modules/platforms/dotnet/Apache.Ignite.Core/Impl/Portable/PortableUtils.cs
@@ -1719,18 +1719,16 @@ namespace Apache.Ignite.Core.Impl.Portable
 
                     for (int i = 0; i < typesCnt; i++)
                     {
-                        PortableTypeConfiguration typCfg = new PortableTypeConfiguration();
-
-                        typCfg.AssemblyName = reader.ReadString();
-                        typCfg.TypeName = reader.ReadString();
-                        typCfg.NameMapper = (IPortableNameMapper)CreateInstance(reader.ReadString());
-                        typCfg.IdMapper = (IPortableIdMapper)CreateInstance(reader.ReadString());
-                        typCfg.Serializer = (IPortableSerializer)CreateInstance(reader.ReadString());
-                        typCfg.AffinityKeyFieldName = reader.ReadString();
-                        typCfg.MetadataEnabled = reader.ReadObject<bool?>();
-                        typCfg.KeepDeserialized = reader.ReadObject<bool?>();
-
-                        cfg.TypeConfigurations.Add(typCfg);
+                        cfg.TypeConfigurations.Add(new PortableTypeConfiguration
+                        {
+                            TypeName = reader.ReadString(),
+                            NameMapper = CreateInstance<IPortableNameMapper>(reader),
+                            IdMapper = CreateInstance<IPortableIdMapper>(reader),
+                            Serializer = CreateInstance<IPortableSerializer>(reader),
+                            AffinityKeyFieldName = reader.ReadString(),
+                            MetadataEnabled = reader.ReadObject<bool?>(),
+                            KeepDeserialized = reader.ReadObject<bool?>()
+                        });
                     }
                 }
 
@@ -1746,9 +1744,9 @@ namespace Apache.Ignite.Core.Impl.Portable
                 }
 
                 // Read the rest.
-                cfg.DefaultNameMapper = (IPortableNameMapper)CreateInstance(reader.ReadString());
-                cfg.DefaultIdMapper = (IPortableIdMapper)CreateInstance(reader.ReadString());
-                cfg.DefaultSerializer = (IPortableSerializer)CreateInstance(reader.ReadString());
+                cfg.DefaultNameMapper = CreateInstance<IPortableNameMapper>(reader);
+                cfg.DefaultIdMapper = CreateInstance<IPortableIdMapper>(reader);
+                cfg.DefaultSerializer = CreateInstance<IPortableSerializer>(reader);
                 cfg.DefaultMetadataEnabled = reader.ReadBoolean();
                 cfg.DefaultKeepDeserialized = reader.ReadBoolean();
             }
@@ -1757,24 +1755,16 @@ namespace Apache.Ignite.Core.Impl.Portable
         }
 
         /// <summary>
-        /// Create new instance of specified class.
+        /// Creates and instance from the type name in reader.
         /// </summary>
-        /// <param name="typeName">Name of the type.</param>
-        /// <returns>New Instance.</returns>
-        public static object CreateInstance(string typeName)
+        private static T CreateInstance<T>(PortableReaderImpl reader)
         {
-            if (typeName == null)
-                return null;
-
-            foreach (Assembly assembly in AppDomain.CurrentDomain.GetAssemblies())
-            {
-                object instance = assembly.CreateInstance(typeName);
+            var typeName = reader.ReadString();
 
-                if (instance != null)
-                    return instance;
-            }
+            if (typeName == null)
+                return default(T);
 
-            throw new PortableException("Failed to find class: " + typeName);
+            return IgniteUtils.CreateInstance<T>(typeName);
         }
 
         /// <summary>

http://git-wip-us.apache.org/repos/asf/ignite/blob/bcb237ae/modules/platforms/dotnet/Apache.Ignite.Core/Portable/PortableTypeConfiguration.cs
----------------------------------------------------------------------
diff --git a/modules/platforms/dotnet/Apache.Ignite.Core/Portable/PortableTypeConfiguration.cs
b/modules/platforms/dotnet/Apache.Ignite.Core/Portable/PortableTypeConfiguration.cs
index bbbd4a8..0c0b79a 100644
--- a/modules/platforms/dotnet/Apache.Ignite.Core/Portable/PortableTypeConfiguration.cs
+++ b/modules/platforms/dotnet/Apache.Ignite.Core/Portable/PortableTypeConfiguration.cs
@@ -57,7 +57,6 @@ namespace Apache.Ignite.Core.Portable
         public PortableTypeConfiguration(PortableTypeConfiguration cfg)
         {
             AffinityKeyFieldName = cfg.AffinityKeyFieldName;
-            AssemblyName = cfg.AssemblyName;
             IdMapper = cfg.IdMapper;
             NameMapper = cfg.NameMapper;
             Serializer = cfg.Serializer;
@@ -67,31 +66,14 @@ namespace Apache.Ignite.Core.Portable
         }
 
         /// <summary>
-        /// Assembly name. 
-        /// </summary>
-        public string AssemblyName
-        {
-            get;
-            set;
-        }
-
-        /// <summary>
         /// Fully qualified type name. 
         /// </summary>
-        public string TypeName
-        {
-            get;
-            set;
-        }
-        
+        public string TypeName { get; set; }
+
         /// <summary>
         /// Name mapper for the given type. 
         /// </summary>
-        public IPortableNameMapper NameMapper
-        {
-            get;
-            set;
-        }
+        public IPortableNameMapper NameMapper { get; set; }
 
         /// <summary>
         /// ID mapper for the given type. When it is necessary to resolve class (field) ID,
then 
@@ -99,11 +81,7 @@ namespace Apache.Ignite.Core.Portable
         /// (PortableFieldIdAttribute) will be checked in class through reflection. If required
         /// attribute is not set, then ID will be hash code of the class (field) simple name
in lower case. 
         /// </summary>
-        public IPortableIdMapper IdMapper
-        {
-            get;
-            set;
-        }
+        public IPortableIdMapper IdMapper { get; set; }
 
         /// <summary>
         /// Serializer for the given type. If not provided and class implements IPortable
@@ -111,40 +89,24 @@ namespace Apache.Ignite.Core.Portable
         /// then all fields of the class except of those with [NotSerialized] attribute will
be serialized
         ///with help of reflection.
         /// </summary>
-        public IPortableSerializer Serializer
-        {
-            get;
-            set;
-        }
+        public IPortableSerializer Serializer { get; set; }
 
         /// <summary>
         /// Affinity key field name.
         /// </summary>
-        public string AffinityKeyFieldName
-        {
-            get;
-            set;
-        }
+        public string AffinityKeyFieldName { get; set; }
 
         /// <summary>
         /// Metadata enabled flag. If set to non-null value, overrides default value set
in 
         /// PortableConfiguration.
         /// </summary>
-        public bool? MetadataEnabled
-        {
-            get;
-            set;
-        }
+        public bool? MetadataEnabled { get; set; }
 
         /// <summary>
         /// Keep deserialized flag. If set to non-null value, overrides default value set
in 
         /// PortableConfiguration.
         /// </summary>
-        public bool? KeepDeserialized
-        {
-            get;
-            set;
-        }
+        public bool? KeepDeserialized { get; set; }
 
         /// <summary>
         /// Returns a string that represents the current object.
@@ -152,11 +114,11 @@ namespace Apache.Ignite.Core.Portable
         /// <returns>
         /// A string that represents the current object.
         /// </returns>
-        override public string ToString()
+        public override string ToString()
         {
-            return typeof(PortableTypeConfiguration).Name + " [TypeName=" + TypeName + 
-                ", NameMapper=" +  NameMapper + ", IdMapper=" + IdMapper + ", Serializer="
+ Serializer +
-                ", AffinityKeyFieldName=" + AffinityKeyFieldName + ']';
+            return typeof (PortableTypeConfiguration).Name + " [TypeName=" + TypeName +
+                   ", NameMapper=" + NameMapper + ", IdMapper=" + IdMapper + ", Serializer="
+ Serializer +
+                   ", AffinityKeyFieldName=" + AffinityKeyFieldName + ']';
         }
     }
 }

http://git-wip-us.apache.org/repos/asf/ignite/blob/bcb237ae/modules/platforms/dotnet/Apache.Ignite.sln
----------------------------------------------------------------------
diff --git a/modules/platforms/dotnet/Apache.Ignite.sln b/modules/platforms/dotnet/Apache.Ignite.sln
index 8d93ffd..6b29e9d 100644
--- a/modules/platforms/dotnet/Apache.Ignite.sln
+++ b/modules/platforms/dotnet/Apache.Ignite.sln
@@ -26,6 +26,10 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution
 	ProjectSection(SolutionItems) = preProject
 		Apache.Ignite.FxCop = Apache.Ignite.FxCop
 		Apache.Ignite.sln.DotSettings = Apache.Ignite.sln.DotSettings
+		examples\Config\example-cache-query.xml = examples\Config\example-cache-query.xml
+		examples\Config\example-cache-store.xml = examples\Config\example-cache-store.xml
+		examples\Config\example-cache.xml = examples\Config\example-cache.xml
+		examples\Config\example-compute.xml = examples\Config\example-compute.xml
 	EndProjectSection
 EndProject
 Global

http://git-wip-us.apache.org/repos/asf/ignite/blob/bcb237ae/modules/platforms/dotnet/examples/Config/example-cache-store.xml
----------------------------------------------------------------------
diff --git a/modules/platforms/dotnet/examples/Config/example-cache-store.xml b/modules/platforms/dotnet/examples/Config/example-cache-store.xml
index adc5f45..2c20531 100644
--- a/modules/platforms/dotnet/examples/Config/example-cache-store.xml
+++ b/modules/platforms/dotnet/examples/Config/example-cache-store.xml
@@ -33,8 +33,7 @@
                     <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"/>
+                            <property name="typeName" value="Apache.Ignite.ExamplesDll.Datagrid.EmployeeStore,
Apache.Ignite.ExamplesDll"/>
                         </bean>
                     </property>
                 </bean>


Mime
View raw message