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/01/23 14:05:50 UTC

[camel] branch master updated: camel-core - Polished startup step events

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

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


The following commit(s) were added to refs/heads/master by this push:
     new 09c8304  camel-core - Polished startup step events
09c8304 is described below

commit 09c8304fc6efa0b7bbd0d552de2746ee750984de
Author: Claus Ibsen <cl...@gmail.com>
AuthorDate: Sat Jan 23 15:05:15 2021 +0100

    camel-core - Polished startup step events
---
 .../camel/impl/engine/AbstractCamelContext.java    | 36 +++++++++++-----------
 .../impl/engine/InternalRouteStartupManager.java   |  6 ++--
 .../org/apache/camel/impl/engine/RouteService.java |  4 +--
 .../org/apache/camel/impl/DefaultCamelContext.java |  2 +-
 .../org/apache/camel/reifier/RouteReifier.java     |  2 +-
 5 files changed, 25 insertions(+), 25 deletions(-)

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 2549d74..97ddf84 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
@@ -581,7 +581,7 @@ public abstract class AbstractCamelContext extends BaseService
             if (component != null && created.get() && autoStart && (isStarted() || isStarting())) {
                 // If the component is looked up after the context is started,
                 // lets start it up.
-                StartupStep step = startupStepRecorder.beginStep(Component.class, name, "Starting Component");
+                StartupStep step = startupStepRecorder.beginStep(Component.class, name, "Start Component");
                 startService(component);
                 startupStepRecorder.endStep(step);
             }
@@ -601,7 +601,7 @@ public abstract class AbstractCamelContext extends BaseService
     private Component initComponent(String name, boolean autoCreateComponents) {
         Component component = null;
         if (autoCreateComponents) {
-            StartupStep step = startupStepRecorder.beginStep(Component.class, name, "Resolving Component");
+            StartupStep step = startupStepRecorder.beginStep(Component.class, name, "Resolve Component");
             try {
                 if (LOG.isDebugEnabled()) {
                     LOG.debug("Using ComponentResolver: {} to resolve component with name: {}", getComponentResolver(), name);
@@ -807,7 +807,7 @@ public abstract class AbstractCamelContext extends BaseService
         // only record startup step during startup (not started)
         if (!isStarted() && startupStepRecorder.isEnabled()) {
             String u = URISupport.sanitizeUri(uri);
-            step = startupStepRecorder.beginStep(Endpoint.class, u, "Getting Endpoint");
+            step = startupStepRecorder.beginStep(Endpoint.class, u, "Get Endpoint");
         }
         Endpoint answer = doGetEndpoint(uri, null, false, false);
         if (step != null) {
@@ -1694,7 +1694,7 @@ public abstract class AbstractCamelContext extends BaseService
                 StartupStep step = null;
                 // only record startup step during startup (not started)
                 if (!isStarted() && startupStepRecorder.isEnabled()) {
-                    step = startupStepRecorder.beginStep(Language.class, name, "Resolving Language");
+                    step = startupStepRecorder.beginStep(Language.class, name, "Resolve Language");
                 }
 
                 final CamelContext camelContext = getCamelContextReference();
@@ -2546,26 +2546,26 @@ public abstract class AbstractCamelContext extends BaseService
         }
 
         startupStepRecorder.start();
-        StartupStep step = startupStepRecorder.beginStep(CamelContext.class, null, "Building CamelContext");
+        StartupStep step = startupStepRecorder.beginStep(CamelContext.class, null, "Build CamelContext");
 
         // Initialize LRUCacheFactory as eager as possible,
         // to let it warm up concurrently while Camel is startup up
         if (initialization != Initialization.Lazy) {
-            StartupStep subStep = startupStepRecorder.beginStep(CamelContext.class, null, "Setting up LRUCacheFactory");
+            StartupStep subStep = startupStepRecorder.beginStep(CamelContext.class, null, "Setup LRUCacheFactory");
             LRUCacheFactory.init();
             startupStepRecorder.endStep(subStep);
         }
 
         // Setup management first since end users may use it to add event
         // notifiers using the management strategy before the CamelContext has been started
-        StartupStep step3 = startupStepRecorder.beginStep(CamelContext.class, null, "Setting up Management");
+        StartupStep step3 = startupStepRecorder.beginStep(CamelContext.class, null, "Setup Management");
         setupManagement(null);
         startupStepRecorder.endStep(step3);
 
         // setup health-check registry as its needed this early phase for 3rd party to register custom repositories
         HealthCheckRegistry hcr = getExtension(HealthCheckRegistry.class);
         if (hcr == null) {
-            StartupStep step4 = startupStepRecorder.beginStep(CamelContext.class, null, "Setting up HealthCheckRegistry");
+            StartupStep step4 = startupStepRecorder.beginStep(CamelContext.class, null, "Setup HealthCheckRegistry");
             hcr = createHealthCheckRegistry();
             if (hcr != null) {
                 // install health-check registry if it was discovered from classpath (camel-health)
@@ -2593,7 +2593,7 @@ public abstract class AbstractCamelContext extends BaseService
     public void doInit() throws Exception {
         StopWatch watch = new StopWatch();
 
-        StartupStep step = startupStepRecorder.beginStep(CamelContext.class, null, "Initializing CamelContext");
+        StartupStep step = startupStepRecorder.beginStep(CamelContext.class, null, "Init CamelContext");
 
         // init the route controller
         this.routeController = getRouteController();
@@ -2709,7 +2709,7 @@ public abstract class AbstractCamelContext extends BaseService
         }
 
         // init the route definitions before the routes is started
-        StartupStep subStep = startupStepRecorder.beginStep(CamelContext.class, getName(), "Initializing routes");
+        StartupStep subStep = startupStepRecorder.beginStep(CamelContext.class, getName(), "Init Routes");
         // the method is called start but at this point it will only initialize (as context is starting up)
         startRouteDefinitions();
         // this will init route definitions and populate as route services which we can then initialize now
@@ -2748,7 +2748,7 @@ public abstract class AbstractCamelContext extends BaseService
         if (!"DefaultStartupStepRecorder".equals(startupStepRecorder.getClass().getSimpleName())) {
             LOG.info("Using startup recorder: {}", startupStepRecorder);
         }
-        StartupStep step = startupStepRecorder.beginStep(CamelContext.class, getName(), "Starting CamelContext");
+        StartupStep step = startupStepRecorder.beginStep(CamelContext.class, getName(), "Start CamelContext");
 
         try {
             doStartContext();
@@ -3031,7 +3031,7 @@ public abstract class AbstractCamelContext extends BaseService
         }
 
         // invoke this logic to warmup the routes and if possible also start the routes
-        StartupStep subStep = startupStepRecorder.beginStep(CamelContext.class, getName(), "Starting Routes");
+        StartupStep subStep = startupStepRecorder.beginStep(CamelContext.class, getName(), "Start Routes");
         EventHelper.notifyCamelContextRoutesStarting(this);
         internalRouteStartupManager.doStartOrResumeRoutes(routeServices, true, !doNotStartRoutesOnFirstStart, false, true);
         EventHelper.notifyCamelContextRoutesStarted(this);
@@ -3300,7 +3300,7 @@ public abstract class AbstractCamelContext extends BaseService
                 routeServices.put(routeService.getId(), routeService);
                 if (shouldStartRoutes()) {
                     StartupStep step
-                            = startupStepRecorder.beginStep(Route.class, routeService.getId(), "Starting Route Services");
+                            = startupStepRecorder.beginStep(Route.class, routeService.getId(), "Start Route Services");
                     // this method will log the routes being started
                     internalRouteStartupManager.safelyStartRouteServices(true, true, true, false, addingRoutes, routeService);
                     // start route services if it was configured to auto startup
@@ -3378,17 +3378,17 @@ public abstract class AbstractCamelContext extends BaseService
      * Force some lazy initialization to occur upfront before we start any components and create routes
      */
     protected void forceLazyInitialization() {
-        StartupStep step = startupStepRecorder.beginStep(CamelContext.class, getName(), "Starting Mandatory Services");
+        StartupStep step = startupStepRecorder.beginStep(CamelContext.class, getName(), "Start Mandatory Services");
         initEagerMandatoryServices();
         startupStepRecorder.endStep(step);
 
         if (initialization != Initialization.Lazy) {
-            step = startupStepRecorder.beginStep(CamelContext.class, getName(), "Starting Standard Services");
+            step = startupStepRecorder.beginStep(CamelContext.class, getName(), "Start Standard Services");
             doStartStandardServices();
             startupStepRecorder.endStep(step);
 
             if (initialization == Initialization.Eager) {
-                step = startupStepRecorder.beginStep(CamelContext.class, getName(), "Starting Eager Services");
+                step = startupStepRecorder.beginStep(CamelContext.class, getName(), "Start Eager Services");
                 doStartEagerServices();
                 startupStepRecorder.endStep(step);
             }
@@ -3933,7 +3933,7 @@ public abstract class AbstractCamelContext extends BaseService
             StartupStep step = null;
             // only record startup step during startup (not started)
             if (!isStarted() && startupStepRecorder.isEnabled()) {
-                step = startupStepRecorder.beginStep(DataFormat.class, name, "Resolving DataFormat");
+                step = startupStepRecorder.beginStep(DataFormat.class, name, "Resolve DataFormat");
             }
 
             DataFormat df = Optional
@@ -3964,7 +3964,7 @@ public abstract class AbstractCamelContext extends BaseService
         StartupStep step = null;
         // only record startup step during startup (not started)
         if (!isStarted() && startupStepRecorder.isEnabled()) {
-            step = startupStepRecorder.beginStep(DataFormat.class, name, "Creating DataFormat");
+            step = startupStepRecorder.beginStep(DataFormat.class, name, "Create DataFormat");
         }
 
         DataFormat answer = getDataFormatResolver().createDataFormat(name, getCamelContextReference());
diff --git a/core/camel-base-engine/src/main/java/org/apache/camel/impl/engine/InternalRouteStartupManager.java b/core/camel-base-engine/src/main/java/org/apache/camel/impl/engine/InternalRouteStartupManager.java
index f3dbf02..02ed0e8 100644
--- a/core/camel-base-engine/src/main/java/org/apache/camel/impl/engine/InternalRouteStartupManager.java
+++ b/core/camel-base-engine/src/main/java/org/apache/camel/impl/engine/InternalRouteStartupManager.java
@@ -82,7 +82,7 @@ class InternalRouteStartupManager {
         try {
             for (RouteService routeService : routeServices.values()) {
                 StartupStep step = abstractCamelContext.getStartupStepRecorder().beginStep(Route.class, routeService.getId(),
-                        "Initializing Route");
+                        "Init Route");
                 try {
                     LOG.debug("Initializing route id: {}", routeService.getId());
                     setupRoute.set(routeService.getRoute());
@@ -297,7 +297,7 @@ class InternalRouteStartupManager {
             // consume messages to be routed
             RouteService routeService = entry.getValue().getRouteService();
             StartupStep step = abstractCamelContext.getStartupStepRecorder().beginStep(Route.class, routeService.getId(),
-                    "Warming up Route");
+                    "Warump Route");
             try {
                 LOG.debug("Warming up route id: {} having autoStartup={}", routeService.getId(), autoStartup);
                 setupRoute.set(routeService.getRoute());
@@ -344,7 +344,7 @@ class InternalRouteStartupManager {
             }
 
             StartupStep step = abstractCamelContext.getStartupStepRecorder().beginStep(Route.class, route.getRouteId(),
-                    "Starting Route");
+                    "Start Route");
 
             // do some preparation before starting the consumer on the route
             Consumer consumer = routeService.getInput();
diff --git a/core/camel-base-engine/src/main/java/org/apache/camel/impl/engine/RouteService.java b/core/camel-base-engine/src/main/java/org/apache/camel/impl/engine/RouteService.java
index fee7458..787fa14 100644
--- a/core/camel-base-engine/src/main/java/org/apache/camel/impl/engine/RouteService.java
+++ b/core/camel-base-engine/src/main/java/org/apache/camel/impl/engine/RouteService.java
@@ -372,7 +372,7 @@ public class RouteService extends ChildServiceSupport {
             boolean record
                     = !(service instanceof InternalProcessor || "RoutePipeline".equals(service.getClass().getSimpleName()));
             if (record) {
-                step = beginStep(service, "Initializing");
+                step = beginStep(service, "Init");
             }
             ServiceHelper.initService(service);
             if (step != null) {
@@ -390,7 +390,7 @@ public class RouteService extends ChildServiceSupport {
             boolean record
                     = !(service instanceof InternalProcessor || "RoutePipeline".equals(service.getClass().getSimpleName()));
             if (record) {
-                step = beginStep(service, "Starting");
+                step = beginStep(service, "Start");
             }
             for (LifecycleStrategy strategy : camelContext.getLifecycleStrategies()) {
                 strategy.onServiceAdd(camelContext, service, route);
diff --git a/core/camel-core-engine/src/main/java/org/apache/camel/impl/DefaultCamelContext.java b/core/camel-core-engine/src/main/java/org/apache/camel/impl/DefaultCamelContext.java
index a6137ff..9916e9f 100644
--- a/core/camel-core-engine/src/main/java/org/apache/camel/impl/DefaultCamelContext.java
+++ b/core/camel-core-engine/src/main/java/org/apache/camel/impl/DefaultCamelContext.java
@@ -600,7 +600,7 @@ public class DefaultCamelContext extends SimpleCamelContext implements ModelCame
 
                 StartupStepRecorder recorder
                         = getCamelContextReference().adapt(ExtendedCamelContext.class).getStartupStepRecorder();
-                StartupStep step = recorder.beginStep(Route.class, routeDefinition.getRouteId(), "Creating Route");
+                StartupStep step = recorder.beginStep(Route.class, routeDefinition.getRouteId(), "Create Route");
                 Route route = model.getModelReifierFactory().createRoute(this, routeDefinition);
                 recorder.endStep(step);
 
diff --git a/core/camel-core-reifier/src/main/java/org/apache/camel/reifier/RouteReifier.java b/core/camel-core-reifier/src/main/java/org/apache/camel/reifier/RouteReifier.java
index 51df38f..3486960 100644
--- a/core/camel-core-reifier/src/main/java/org/apache/camel/reifier/RouteReifier.java
+++ b/core/camel-core-reifier/src/main/java/org/apache/camel/reifier/RouteReifier.java
@@ -231,7 +231,7 @@ public class RouteReifier extends ProcessorReifier<RouteDefinition> {
                 String outputId = output.idOrCreate(camelContext.adapt(ExtendedCamelContext.class).getNodeIdFactory());
                 String eip = reifier.getClass().getSimpleName().replace("Reifier", "");
                 StartupStep step = camelContext.adapt(ExtendedCamelContext.class).getStartupStepRecorder()
-                        .beginStep(Processor.class, outputId, "Creating " + eip + " Processor");
+                        .beginStep(ProcessorReifier.class, outputId, "Create " + eip + " Processor");
 
                 reifier.addRoutes();