You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by da...@apache.org on 2021/12/22 13:36:18 UTC

[camel] 01/02: CAMEL-17236: camel-core - Remove classic startup summary level

This is an automated email from the ASF dual-hosted git repository.

davsclaus pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/camel.git

commit 241f7172d5d722e885f57171d92501d816a73d64
Author: Claus Ibsen <cl...@gmail.com>
AuthorDate: Wed Dec 22 14:30:25 2021 +0100

    CAMEL-17236: camel-core - Remove classic startup summary level
---
 .../java/org/apache/camel/StartupSummaryLevel.java |  2 -
 .../apache/camel/catalog/RuntimeCamelCatalog.java  |  1 -
 .../camel/impl/engine/AbstractCamelContext.java    | 54 ++++------------------
 .../ROOT/pages/camel-3x-upgrade-guide-3_15.adoc    |  4 ++
 4 files changed, 13 insertions(+), 48 deletions(-)

diff --git a/core/camel-api/src/main/java/org/apache/camel/StartupSummaryLevel.java b/core/camel-api/src/main/java/org/apache/camel/StartupSummaryLevel.java
index 8f20f6a..097ffa0 100644
--- a/core/camel-api/src/main/java/org/apache/camel/StartupSummaryLevel.java
+++ b/core/camel-api/src/main/java/org/apache/camel/StartupSummaryLevel.java
@@ -24,8 +24,6 @@ import javax.xml.bind.annotation.XmlEnum;
 @XmlEnum
 public enum StartupSummaryLevel {
 
-    @Deprecated
-    Classic,
     Verbose,
     Default,
     Brief,
diff --git a/core/camel-api/src/main/java/org/apache/camel/catalog/RuntimeCamelCatalog.java b/core/camel-api/src/main/java/org/apache/camel/catalog/RuntimeCamelCatalog.java
index d14a4c7..dec884f 100644
--- a/core/camel-api/src/main/java/org/apache/camel/catalog/RuntimeCamelCatalog.java
+++ b/core/camel-api/src/main/java/org/apache/camel/catalog/RuntimeCamelCatalog.java
@@ -22,7 +22,6 @@ import java.util.Map;
 import org.apache.camel.CamelContextAware;
 import org.apache.camel.StaticService;
 import org.apache.camel.component.extension.ComponentVerifierExtension;
-import org.apache.camel.spi.EndpointUriFactory;
 import org.apache.camel.spi.SendDynamicAware;
 
 /**
diff --git a/core/camel-base-engine/src/main/java/org/apache/camel/impl/engine/AbstractCamelContext.java b/core/camel-base-engine/src/main/java/org/apache/camel/impl/engine/AbstractCamelContext.java
index 02aeae9..47f50f8 100644
--- a/core/camel-base-engine/src/main/java/org/apache/camel/impl/engine/AbstractCamelContext.java
+++ b/core/camel-base-engine/src/main/java/org/apache/camel/impl/engine/AbstractCamelContext.java
@@ -1226,7 +1226,7 @@ public abstract class AbstractCamelContext extends BaseService
             }
         }
 
-        if (startupSummaryLevel != StartupSummaryLevel.Classic && startupSummaryLevel != StartupSummaryLevel.Oneline
+        if (startupSummaryLevel != StartupSummaryLevel.Oneline
                 && startupSummaryLevel != StartupSummaryLevel.Off) {
             logRouteStopSummary(LoggingLevel.INFO);
         }
@@ -2717,8 +2717,8 @@ public abstract class AbstractCamelContext extends BaseService
 
         // init the route controller
         this.routeController = getRouteController();
-        if (startupSummaryLevel == StartupSummaryLevel.Classic || startupSummaryLevel == StartupSummaryLevel.Verbose) {
-            // classic/verbose startup should let route controller do the route startup logging
+        if (startupSummaryLevel == StartupSummaryLevel.Verbose) {
+            // verbose startup should let route controller do the route startup logging
             if (routeController.getLoggingLevel().ordinal() < LoggingLevel.INFO.ordinal()) {
                 routeController.setLoggingLevel(LoggingLevel.INFO);
             }
@@ -2726,8 +2726,8 @@ public abstract class AbstractCamelContext extends BaseService
 
         // init the shutdown strategy
         this.shutdownStrategy = getShutdownStrategy();
-        if (startupSummaryLevel == StartupSummaryLevel.Classic || startupSummaryLevel == StartupSummaryLevel.Verbose) {
-            // classic/verbose startup should let route controller do the route shutdown logging
+        if (startupSummaryLevel == StartupSummaryLevel.Verbose) {
+            // verbose startup should let route controller do the route shutdown logging
             if (shutdownStrategy != null && shutdownStrategy.getLoggingLevel().ordinal() < LoggingLevel.INFO.ordinal()) {
                 shutdownStrategy.setLoggingLevel(LoggingLevel.INFO);
             }
@@ -2917,10 +2917,7 @@ public abstract class AbstractCamelContext extends BaseService
     }
 
     protected void doStartContext() throws Exception {
-        if (startupSummaryLevel == StartupSummaryLevel.Classic) {
-            // classic was logging this at INFO level
-            LOG.info("Apache Camel {} ({}) is starting", getVersion(), getName());
-        } else if (LOG.isDebugEnabled()) {
+        if (LOG.isDebugEnabled()) {
             LOG.debug("Apache Camel {} ({}) is starting", getVersion(), getName());
         }
         vetoed = null;
@@ -2966,11 +2963,7 @@ public abstract class AbstractCamelContext extends BaseService
         logDuplicateComponents();
 
         // log startup summary
-        if (startupSummaryLevel == StartupSummaryLevel.Classic) {
-            logClassicStartSummary();
-        } else {
-            logStartSummary();
-        }
+        logStartSummary();
 
         // now Camel has been started/bootstrap is complete, then run cleanup to help free up memory etc
         for (BootstrapCloseable bootstrap : bootstraps) {
@@ -3025,29 +3018,6 @@ public abstract class AbstractCamelContext extends BaseService
 
     }
 
-    protected void logClassicStartSummary() {
-        if (LOG.isInfoEnabled()) {
-            // count how many routes are actually started
-            int started = 0;
-            for (Route route : getRoutes()) {
-                ServiceStatus status = getRouteStatus(route.getId());
-                if (status != null && status.isStarted()) {
-                    started++;
-                }
-            }
-
-            final Collection<Route> controlledRoutes = getRouteController().getControlledRoutes();
-            if (controlledRoutes.isEmpty()) {
-                LOG.info("Total {} routes, of which {} are started", getRoutes().size(), started);
-            } else {
-                LOG.info("Total {} routes, of which {} are started, and {} are managed by RouteController: {}",
-                        getRoutes().size(), started, controlledRoutes.size(),
-                        getRouteController().getClass().getName());
-            }
-            LOG.info("Apache Camel {} ({}) started in {}", getVersion(), getName(), TimeUtils.printDuration(stopWatch.taken()));
-        }
-    }
-
     protected void logStartSummary() {
         // supervising route controller should do their own startup log summary
         boolean supervised = getRouteController().isSupervising();
@@ -3366,7 +3336,7 @@ public abstract class AbstractCamelContext extends BaseService
         }
         shutdownServices(list, false);
 
-        if (startupSummaryLevel != StartupSummaryLevel.Classic && startupSummaryLevel != StartupSummaryLevel.Oneline
+        if (startupSummaryLevel != StartupSummaryLevel.Oneline
                 && startupSummaryLevel != StartupSummaryLevel.Off) {
             logRouteStopSummary(LoggingLevel.INFO);
         }
@@ -3452,13 +3422,7 @@ public abstract class AbstractCamelContext extends BaseService
         // stop the lazy created so they can be re-created on restart
         forceStopLazyInitialization();
 
-        if (startupSummaryLevel == StartupSummaryLevel.Classic) {
-            if (LOG.isInfoEnabled()) {
-                LOG.info("Apache Camel {} ({}) uptime {}", getVersion(), getName(), getUptime());
-                LOG.info("Apache Camel {} ({}) is shutdown in {}", getVersion(), getName(),
-                        TimeUtils.printDuration(stopWatch.taken()));
-            }
-        } else if (startupSummaryLevel != StartupSummaryLevel.Off) {
+        if (startupSummaryLevel != StartupSummaryLevel.Off) {
             if (LOG.isInfoEnabled()) {
                 String taken = TimeUtils.printDuration(stopWatch.taken());
                 LOG.info("Apache Camel {} ({}) shutdown in {} (uptime:{})", getVersion(), getName(), taken, getUptime());
diff --git a/docs/user-manual/modules/ROOT/pages/camel-3x-upgrade-guide-3_15.adoc b/docs/user-manual/modules/ROOT/pages/camel-3x-upgrade-guide-3_15.adoc
index 0062670..0c7d3ae 100644
--- a/docs/user-manual/modules/ROOT/pages/camel-3x-upgrade-guide-3_15.adoc
+++ b/docs/user-manual/modules/ROOT/pages/camel-3x-upgrade-guide-3_15.adoc
@@ -10,6 +10,10 @@ from both 3.0 to 3.1 and 3.1 to 3.2.
 
 Added `getScheme` method to `org.apache.camel.spi.Resource`.
 
+=== camel-core
+
+Removed the deprecated `Classic` value from `startupSummaryLevel` enums.
+
 === camel-endpointdsl
 
 The Endpoint DSL is now more type-safe, where previously an option would be declared as `Object` type,