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 2017/03/21 09:24:29 UTC

[38/71] [abbrv] ignite git commit: IGNITE-4819 Start .NET plugins before OnIgniteStart

IGNITE-4819 Start .NET plugins before OnIgniteStart


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

Branch: refs/heads/master
Commit: 5db0c020913bd102a910705b7614ff5ed9c56629
Parents: 901be4f
Author: Pavel Tupitsyn <pt...@apache.org>
Authored: Tue Mar 14 17:18:40 2017 +0300
Committer: Pavel Tupitsyn <pt...@apache.org>
Committed: Tue Mar 14 17:18:40 2017 +0300

----------------------------------------------------------------------
 .../Apache.Ignite.Core.Tests/Plugin/PluginTest.cs      |  1 -
 .../Plugin/TestIgnitePluginProvider.cs                 | 13 ++++++++-----
 .../Apache.Ignite.Core/Impl/Plugin/PluginProcessor.cs  | 12 ++++++++++--
 3 files changed, 18 insertions(+), 8 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/5db0c020/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Plugin/PluginTest.cs
----------------------------------------------------------------------
diff --git a/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Plugin/PluginTest.cs b/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Plugin/PluginTest.cs
index efb14ff..b6c00b5 100644
--- a/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Plugin/PluginTest.cs
+++ b/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Plugin/PluginTest.cs
@@ -173,7 +173,6 @@ namespace Apache.Ignite.Core.Tests.Plugin
                 new[]
                 {
                     "normalPlugin.Start", "errPlugin.Start",
-                    "errPlugin.OnIgniteStop", "normalPlugin.OnIgniteStop",
                     "errPlugin.Stop", "normalPlugin.Stop"
                 }, PluginLog);
         }

http://git-wip-us.apache.org/repos/asf/ignite/blob/5db0c020/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Plugin/TestIgnitePluginProvider.cs
----------------------------------------------------------------------
diff --git a/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Plugin/TestIgnitePluginProvider.cs b/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Plugin/TestIgnitePluginProvider.cs
index 161d797..7282e92 100644
--- a/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Plugin/TestIgnitePluginProvider.cs
+++ b/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Plugin/TestIgnitePluginProvider.cs
@@ -83,7 +83,7 @@ namespace Apache.Ignite.Core.Tests.Plugin
 
             Context = context;
 
-            EnsureIgniteWorks();
+            EnsureIgniteWorks(false);
         }
 
         /** <inheritdoc /> */
@@ -91,7 +91,7 @@ namespace Apache.Ignite.Core.Tests.Plugin
         {
             Stopped = cancel;
 
-            EnsureIgniteWorks();
+            EnsureIgniteWorks(false);
         }
 
         /** <inheritdoc /> */
@@ -135,16 +135,19 @@ namespace Apache.Ignite.Core.Tests.Plugin
         /// <summary>
         /// Ensures that Ignite instance is functional.
         /// </summary>
-        private void EnsureIgniteWorks()
+        private void EnsureIgniteWorks(bool checkCache = true)
         {
             Assert.NotNull(Context);
             Assert.NotNull(Context.Ignite);
             Assert.NotNull(Context.IgniteConfiguration);
             Assert.NotNull(Context.PluginConfiguration);
 
-            var cache = Context.Ignite.GetOrCreateCache<int, int>("pluginCache");
+            if (checkCache)
+            {
+                var cache = Context.Ignite.GetOrCreateCache<int, int>("pluginCache");
 
-            Assert.AreEqual(0, cache.GetSize());
+                Assert.AreEqual(0, cache.GetSize());
+            }
         }
     }
 }
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ignite/blob/5db0c020/modules/platforms/dotnet/Apache.Ignite.Core/Impl/Plugin/PluginProcessor.cs
----------------------------------------------------------------------
diff --git a/modules/platforms/dotnet/Apache.Ignite.Core/Impl/Plugin/PluginProcessor.cs b/modules/platforms/dotnet/Apache.Ignite.Core/Impl/Plugin/PluginProcessor.cs
index 7ed7141..11100ff 100644
--- a/modules/platforms/dotnet/Apache.Ignite.Core/Impl/Plugin/PluginProcessor.cs
+++ b/modules/platforms/dotnet/Apache.Ignite.Core/Impl/Plugin/PluginProcessor.cs
@@ -62,6 +62,16 @@ namespace Apache.Ignite.Core.Impl.Plugin
             Debug.Assert(ignite != null);
 
             _ignite = ignite;
+
+            try
+            {
+                LoadPlugins();
+            }
+            catch (Exception)
+            {
+                Stop(true);
+                throw;
+            }
         }
 
         /// <summary>
@@ -85,8 +95,6 @@ namespace Apache.Ignite.Core.Impl.Plugin
         /// </summary>
         public void OnIgniteStart()
         {
-            LoadPlugins();
-
             // Notify plugins.
             foreach (var provider in _pluginProviders)
                 provider.OnIgniteStart();