IGNITE-5343 .NET: Work with JNI directly, get rid of C++ layer
authorPavel Tupitsyn <ptupitsyn@apache.org>
Tue, 14 Nov 2017 19:50:57 +0000 (22:50 +0300)
committerPavel Tupitsyn <ptupitsyn@apache.org>
Tue, 14 Nov 2017 19:50:57 +0000 (22:50 +0300)
Fix ConsoleWriter lifetime

This closes #2985

modules/platforms/dotnet/Apache.Ignite.Core/Impl/Unmanaged/Jni/ConsoleWriter.cs
modules/platforms/dotnet/Apache.Ignite.Core/Impl/Unmanaged/Jni/Jvm.cs

index ef4be1e..b1baf79 100644 (file)
@@ -36,5 +36,12 @@ namespace Apache.Ignite.Core.Impl.Unmanaged.Jni
             var target = isError ? Console.Error : Console.Out;
             target.Write(message);
         }
+
+        /** <inheritdoc /> */
+        public override object InitializeLifetimeService()
+        {
+            // Ensure that cross-AppDomain reference lives forever.
+            return null;
+        }
     }
 }
index 10c7468..55331c7 100644 (file)
@@ -49,7 +49,7 @@ namespace Apache.Ignite.Core.Impl.Unmanaged.Jni
         /** Callbacks. */
         private readonly Callbacks _callbacks;
 
-        /** Static instamce */
+        /** Static instance */
         private static volatile Jvm _instance;
 
         /** Sync. */