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

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

commit 72c1f118be4ca9ae479b42175e605991390d6471
Author: Nicola Ferraro <[email protected]>
AuthorDate: Mon Jan 13 10:10:42 2020 +0100

    CAMEL-14385: moving initialization to doStart
---
 .../main/java/org/apache/camel/component/cron/CronComponent.java | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git 
a/components/camel-cron/src/main/java/org/apache/camel/component/cron/CronComponent.java
 
b/components/camel-cron/src/main/java/org/apache/camel/component/cron/CronComponent.java
index 19192fc..9c90b7d 100644
--- 
a/components/camel-cron/src/main/java/org/apache/camel/component/cron/CronComponent.java
+++ 
b/components/camel-cron/src/main/java/org/apache/camel/component/cron/CronComponent.java
@@ -43,8 +43,6 @@ public class CronComponent extends DefaultComponent {
 
     @Override
     public Endpoint createEndpoint(String uri, String remaining, Map<String, 
Object> properties) throws Exception {
-        initCamelCronService();
-
         CamelCronConfiguration configuration = new CamelCronConfiguration();
         configuration.setName(remaining);
         setProperties(configuration, properties);
@@ -61,10 +59,15 @@ public class CronComponent extends DefaultComponent {
         return cronEndpoint;
     }
 
+    @Override
+    protected void doStart() throws Exception {
+        initCamelCronService();
+    }
+
     /**
      * Lazy creation of the CamelCronService
      */
-    public synchronized void initCamelCronService() {
+    public void initCamelCronService() {
         if (this.service == null) {
             this.service = CronHelper.resolveCamelCronService(
                     getCamelContext(),

Reply via email to