ignite-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From akuznet...@apache.org
Subject [04/26] incubator-ignite git commit: #ignite-311: move version from plugin to plugin configuration.
Date Fri, 27 Feb 2015 18:33:44 GMT
#ignite-311: move version from plugin to plugin configuration.


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

Branch: refs/heads/ignite-187
Commit: 51acac6bbf338d083310507b6975a1724c141d7e
Parents: da5f520
Author: ivasilinets <ivasilinets@gridgain.com>
Authored: Fri Feb 20 13:47:59 2015 +0300
Committer: ivasilinets <ivasilinets@gridgain.com>
Committed: Fri Feb 20 13:47:59 2015 +0300

----------------------------------------------------------------------
 .../apache/ignite/internal/IgniteKernal.java    | 31 ++++++++------------
 .../org/apache/ignite/plugin/IgnitePlugin.java  |  5 +---
 .../ignite/plugin/PluginConfiguration.java      | 10 +++++++
 3 files changed, 24 insertions(+), 22 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/51acac6b/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 acb5131..922c20b 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
@@ -454,8 +454,9 @@ public class IgniteKernal implements IgniteEx, IgniteMXBean, Externalizable
{
     @Override public Collection<String> getUserAttributesFormatted() {
         assert cfg != null;
 
-        return F.transform(cfg.getUserAttributes().entrySet(), new C1<Map.Entry<String,?>,String>()
{
-            @Override public String apply(Map.Entry<String,?> e) {
+        return F.transform(cfg.getUserAttributes().entrySet(), new C1<Map.Entry<String,
?>, String>() {
+            @Override
+            public String apply(Map.Entry<String, ?> e) {
                 return e.getKey() + ", " + e.getValue().toString();
             }
         });
@@ -608,7 +609,7 @@ public class IgniteKernal implements IgniteEx, IgniteMXBean, Externalizable
{
         RuntimeMXBean rtBean = ManagementFactory.getRuntimeMXBean();
 
         // Ack various information.
-        ackAsciiLogo(false);
+        ackAsciiLogo();
         ackConfigUrl();
         ackDaemon();
         ackOsInfo();
@@ -772,8 +773,6 @@ public class IgniteKernal implements IgniteEx, IgniteMXBean, Externalizable
{
                 provider.start(ctx.plugins().pluginContextForProvider(provider), attrs);
             }
 
-            ackAsciiLogo(true);
-
             gw.writeLock();
 
             try {
@@ -1524,10 +1523,8 @@ public class IgniteKernal implements IgniteEx, IgniteMXBean, Externalizable
{
 
     /**
      * Acks ASCII-logo. Thanks to http://patorjk.com/software/taag
-     *
-     * @param pluginInfo Whether print plugin information or not.
-      */
-    private void ackAsciiLogo(boolean pluginInfo) {
+     */
+    private void ackAsciiLogo() {
         assert log != null;
 
         String fileName = log.fileName();
@@ -1546,7 +1543,7 @@ public class IgniteKernal implements IgniteEx, IgniteMXBean, Externalizable
{
                     " ",
                     ver,
                     COPYRIGHT,
-                    pluginInfo ? pluginInfo() : "",
+                    pluginInfo(),
                     "",
                     "Quiet mode.");
 
@@ -1565,10 +1562,8 @@ public class IgniteKernal implements IgniteEx, IgniteMXBean, Externalizable
{
                 ">>> /___/\\___/_/|_/___/ /_/ /___/   " + NL +
                 ">>> " + NL +
                 ">>> " + ver + NL +
-                ">>> " + COPYRIGHT + NL;
-
-            if (pluginInfo)
-                info += ">>> " + pluginInfo();
+                ">>> " + COPYRIGHT + NL +
+                ">>> " + pluginInfo();
 
             if (log.isInfoEnabled())
                 log.info(info);
@@ -1576,15 +1571,15 @@ public class IgniteKernal implements IgniteEx, IgniteMXBean, Externalizable
{
     }
 
     private String pluginInfo() {
-        Collection<PluginProvider> pluginProviders = ctx.plugins().allProviders();
+        Collection<? extends PluginConfiguration> pluginsCfg = cfg.getPluginConfigurations();
 
-        if (pluginProviders.size() == 0)
+        if (pluginsCfg.size() == 0)
             return PLUGIN_INFO + "none";
 
         String info = PLUGIN_INFO + NL;
 
-        for (PluginProvider provider : pluginProviders)
-            info += provider.plugin().name() + " " + provider.plugin().version() + NL;
+        for (PluginConfiguration cfg : pluginsCfg)
+            info += cfg.name() + " " + cfg.version() + NL;
 
         return info;
     }

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/51acac6b/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 020252d..6a928af 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,8 +24,5 @@ package org.apache.ignite.plugin;
  * @version @java.version
  */
 public interface IgnitePlugin {
-
-    public String name();
-
-    public String version();
+    // No-op.
 }

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/51acac6b/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 f30e897..9323d6f 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,4 +28,14 @@ public interface PluginConfiguration {
      * @return Plugin provider class.
      */
     public Class<? extends PluginProvider> providerClass();
+
+    /**
+     * @return Plugin name.
+     */
+    public String name();
+
+    /**
+     * @return Plugin version.
+     */
+    public String version();
 }


Mime
View raw message