ignite-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sboi...@apache.org
Subject [02/25] incubator-ignite git commit: #ignite-311: Output plugin's information.
Date Fri, 27 Feb 2015 16:57:31 GMT
#ignite-311: Output plugin's information.


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

Branch: refs/heads/sprint-2
Commit: 1ad3bcad975c049f3c306f580e685cf374044abc
Parents: 446192f
Author: ivasilinets <ivasilinets@gridgain.com>
Authored: Thu Feb 19 18:56:14 2015 +0300
Committer: ivasilinets <ivasilinets@gridgain.com>
Committed: Thu Feb 19 18:56:14 2015 +0300

----------------------------------------------------------------------
 .../apache/ignite/internal/IgniteKernal.java    | 53 ++++++++++++++------
 .../org/apache/ignite/plugin/IgnitePlugin.java  |  5 +-
 2 files changed, 43 insertions(+), 15 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/1ad3bcad/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 e352099..acb5131 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
@@ -106,6 +106,9 @@ public class IgniteKernal implements IgniteEx, IgniteMXBean, Externalizable
{
     /** Ignite site that is shown in log messages. */
     static final String SITE = "www.gridgain.com";
 
+    /** Plugin information. */
+    public static final String PLUGIN_INFO = "Configured plugins: ";
+
     /** System line separator. */
     private static final String NL = U.nl();
 
@@ -605,7 +608,7 @@ public class IgniteKernal implements IgniteEx, IgniteMXBean, Externalizable
{
         RuntimeMXBean rtBean = ManagementFactory.getRuntimeMXBean();
 
         // Ack various information.
-        ackAsciiLogo();
+        ackAsciiLogo(false);
         ackConfigUrl();
         ackDaemon();
         ackOsInfo();
@@ -769,6 +772,8 @@ public class IgniteKernal implements IgniteEx, IgniteMXBean, Externalizable
{
                 provider.start(ctx.plugins().pluginContextForProvider(provider), attrs);
             }
 
+            ackAsciiLogo(true);
+
             gw.writeLock();
 
             try {
@@ -1519,8 +1524,10 @@ public class IgniteKernal implements IgniteEx, IgniteMXBean, Externalizable
{
 
     /**
      * Acks ASCII-logo. Thanks to http://patorjk.com/software/taag
-     */
-    private void ackAsciiLogo() {
+     *
+     * @param pluginInfo Whether print plugin information or not.
+      */
+    private void ackAsciiLogo(boolean pluginInfo) {
         assert log != null;
 
         String fileName = log.fileName();
@@ -1539,6 +1546,7 @@ public class IgniteKernal implements IgniteEx, IgniteMXBean, Externalizable
{
                     " ",
                     ver,
                     COPYRIGHT,
+                    pluginInfo ? pluginInfo() : "",
                     "",
                     "Quiet mode.");
 
@@ -1550,20 +1558,37 @@ public class IgniteKernal implements IgniteEx, IgniteMXBean, Externalizable
{
                     "");
             }
 
-            if (log.isInfoEnabled()) {
-                log.info(NL + NL +
-                    ">>>    __________  ________________  " + NL +
-                    ">>>   /  _/ ___/ |/ /  _/_  __/ __/  " + NL +
-                    ">>>  _/ // (7 7    // /  / / / _/    " + NL +
-                    ">>> /___/\\___/_/|_/___/ /_/ /___/   " + NL +
-                    ">>> " + NL +
-                    ">>> " + ver + NL +
-                    ">>> " + COPYRIGHT + NL
-                );
-            }
+            String info = NL + NL +
+                ">>>    __________  ________________  " + NL +
+                ">>>   /  _/ ___/ |/ /  _/_  __/ __/  " + NL +
+                ">>>  _/ // (7 7    // /  / / / _/    " + NL +
+                ">>> /___/\\___/_/|_/___/ /_/ /___/   " + NL +
+                ">>> " + NL +
+                ">>> " + ver + NL +
+                ">>> " + COPYRIGHT + NL;
+
+            if (pluginInfo)
+                info += ">>> " + pluginInfo();
+
+            if (log.isInfoEnabled())
+                log.info(info);
         }
     }
 
+    private String pluginInfo() {
+        Collection<PluginProvider> pluginProviders = ctx.plugins().allProviders();
+
+        if (pluginProviders.size() == 0)
+            return PLUGIN_INFO + "none";
+
+        String info = PLUGIN_INFO + NL;
+
+        for (PluginProvider provider : pluginProviders)
+            info += provider.plugin().name() + " " + provider.plugin().version() + NL;
+
+        return info;
+    }
+
     /**
      * Prints start info.
      *

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/1ad3bcad/modules/core/src/main/java/org/apache/ignite/plugin/IgnitePlugin.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/plugin/IgnitePlugin.java b/modules/core/src/main/java/org/apache/ignite/plugin/IgnitePlugin.java
index 6a928af..020252d 100644
--- a/modules/core/src/main/java/org/apache/ignite/plugin/IgnitePlugin.java
+++ b/modules/core/src/main/java/org/apache/ignite/plugin/IgnitePlugin.java
@@ -24,5 +24,8 @@ package org.apache.ignite.plugin;
  * @version @java.version
  */
 public interface IgnitePlugin {
-    // No-op.
+
+    public String name();
+
+    public String version();
 }


Mime
View raw message