ignite-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sboi...@apache.org
Subject [16/26] incubator-ignite git commit: #ignite-311: move version to PluginProvider
Date Fri, 27 Feb 2015 17:04:00 GMT
#ignite-311: move version to PluginProvider


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

Branch: refs/heads/ignite-237
Commit: 4397d2296c0575c23f52be4f18f32f38997066f8
Parents: a96bb10
Author: ivasilinets <ivasilinets@gridgain.com>
Authored: Fri Feb 20 18:59:31 2015 +0300
Committer: ivasilinets <ivasilinets@gridgain.com>
Committed: Fri Feb 20 18:59:31 2015 +0300

----------------------------------------------------------------------
 .../apache/ignite/internal/IgniteKernal.java    | 69 +++++++++++---------
 .../ignite/plugin/PluginConfiguration.java      | 15 -----
 .../apache/ignite/plugin/PluginProvider.java    |  5 ++
 3 files changed, 43 insertions(+), 46 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/4397d229/modules/core/src/main/java/org/apache/ignite/internal/IgniteKernal.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/IgniteKernal.java b/modules/core/src/main/java/org/apache/ignite/internal/IgniteKernal.java
index 7e9427d..1a084aa 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/IgniteKernal.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/IgniteKernal.java
@@ -708,6 +708,8 @@ public class IgniteKernal implements IgniteEx, IgniteMXBean, Externalizable
{
 
             startProcessor(ctx, new IgnitePluginProcessor(ctx, cfg), attrs);
 
+            ackPluginsInfo();
+
             // Off-heap processor has no dependencies.
             startProcessor(ctx, new GridOffHeapProcessor(ctx), attrs);
 
@@ -1534,18 +1536,16 @@ public class IgniteKernal implements IgniteEx, IgniteMXBean, Externalizable
{
             // Big thanks to: http://patorjk.com/software/taag
             // Font name "Small Slant"
             if (log.isQuiet()) {
-                List<String> info = new ArrayList<>();
-                info.add("   __________  ________________ ");
-                info.add("  /  _/ ___/ |/ /  _/_  __/ __/ ");
-                info.add(" _/ // (7 7    // /  / / / _/   ");
-                info.add("/___/\\___/_/|_/___/ /_/ /___/  ");
-                info.add(" ");
-                info.add(COPYRIGHT);
-                info.addAll(Arrays.asList(pluginInfo().split(NL + ">>> ")));
-                info.add("");
-                info.add("Quiet mode.");
-
-                U.quiet(false, info.toArray(new String[info.size()]));
+                U.quiet(false,
+                    "   __________  ________________ ",
+                    "  /  _/ ___/ |/ /  _/_  __/ __/ ",
+                    " _/ // (7 7    // /  / / / _/   ",
+                    "/___/\\___/_/|_/___/ /_/ /___/  ",
+                    " ",
+                    ver,
+                    COPYRIGHT,
+                    "",
+                    "Quiet mode.");
 
                 if (fileName != null)
                     U.quiet(false, "  ^-- Logging to file '" +  fileName + '\'');
@@ -1555,36 +1555,43 @@ public class IgniteKernal implements IgniteEx, IgniteMXBean, Externalizable
{
                     "");
             }
 
-            String info = NL + NL +
-                ">>>    __________  ________________  " + NL +
-                ">>>   /  _/ ___/ |/ /  _/_  __/ __/  " + NL +
-                ">>>  _/ // (7 7    // /  / / / _/    " + NL +
-                ">>> /___/\\___/_/|_/___/ /_/ /___/   " + NL +
-                ">>> " + NL +
-                ">>> " + ver + NL +
-                ">>> " + COPYRIGHT + NL +
-                ">>> " + pluginInfo();
-
-            if (log.isInfoEnabled())
-                log.info(info);
+            if (log.isInfoEnabled()) {
+                log.info(NL + NL +
+                        ">>>    __________  ________________  " + NL +
+                        ">>>   /  _/ ___/ |/ /  _/_  __/ __/  " + NL +
+                        ">>>  _/ // (7 7    // /  / / / _/    " + NL +
+                        ">>> /___/\\___/_/|_/___/ /_/ /___/   " + NL +
+                        ">>> " + NL +
+                        ">>> " + ver + NL +
+                        ">>> " + COPYRIGHT + NL
+                );
+            }
         }
     }
 
     private String pluginInfo() {
-        Collection<? extends PluginConfiguration> pluginsCfg = cfg.getPluginConfigurations();
+        Collection<PluginProvider> plugins = ctx.plugins().allProviders();
 
-        if (pluginsCfg.size() == 0)
-            return PLUGIN_INFO + "none";
+        if (plugins.size() == 0)
+            return NL + ">>>    " + PLUGIN_INFO + "none";
 
-        String info = PLUGIN_INFO + NL;
+        String info = NL + ">>>    " + PLUGIN_INFO + NL;
 
-        for (PluginConfiguration cfg : pluginsCfg)
-            info += ">>>    " + cfg.name() + " " + cfg.version() + NL +
-                ">>>    " + cfg.copyright();
+        for (PluginProvider plugin : plugins)
+            info += ">>>    " + plugin.name() + " " + plugin.version() + NL +
+                ">>>    " + plugin.copyright();
 
         return info;
     }
 
+    private void ackPluginsInfo() {
+        if (log.isQuiet())
+            U.quiet(false, pluginInfo().split(NL + ">>> "));
+
+        if (log.isInfoEnabled())
+            log.info(">>> " + pluginInfo());
+    }
+
     /**
      * Prints start info.
      *

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/4397d229/modules/core/src/main/java/org/apache/ignite/plugin/PluginConfiguration.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/plugin/PluginConfiguration.java
b/modules/core/src/main/java/org/apache/ignite/plugin/PluginConfiguration.java
index 568f1ab..f30e897 100644
--- a/modules/core/src/main/java/org/apache/ignite/plugin/PluginConfiguration.java
+++ b/modules/core/src/main/java/org/apache/ignite/plugin/PluginConfiguration.java
@@ -28,19 +28,4 @@ public interface PluginConfiguration {
      * @return Plugin provider class.
      */
     public Class<? extends PluginProvider> providerClass();
-
-    /**
-     * @return Plugin name.
-     */
-    public String name();
-
-    /**
-     * @return Plugin version.
-     */
-    public String version();
-
-    /**
-     * @return Copyright.
-     */
-    public String copyright();
 }

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/4397d229/modules/core/src/main/java/org/apache/ignite/plugin/PluginProvider.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/plugin/PluginProvider.java b/modules/core/src/main/java/org/apache/ignite/plugin/PluginProvider.java
index 41b7216..e41d6f7 100644
--- a/modules/core/src/main/java/org/apache/ignite/plugin/PluginProvider.java
+++ b/modules/core/src/main/java/org/apache/ignite/plugin/PluginProvider.java
@@ -41,6 +41,11 @@ public interface PluginProvider<C extends PluginConfiguration> {
     public String version();
 
     /**
+     * @return Copyright.
+     */
+    public String copyright();
+
+    /**
      * @return Plugin API.
      */
     public <T extends IgnitePlugin> T plugin();


Mime
View raw message