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 2020/05/14 06:03:10 UTC

[camel] branch CAMEL-15057 created (now bf32212)

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

davsclaus pushed a change to branch CAMEL-15057
in repository https://gitbox.apache.org/repos/asf/camel.git.


      at bf32212  CAMEL-15057: camel-webhook should start/stop delegate endpoint before register webhook.

This branch includes the following new commits:

     new bf32212  CAMEL-15057: camel-webhook should start/stop delegate endpoint before register webhook.

The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.



[camel] 01/01: CAMEL-15057: camel-webhook should start/stop delegate endpoint before register webhook.

Posted by da...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

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

commit bf322124b2a0001625adb65b69facdfd074d3d9c
Author: Claus Ibsen <cl...@gmail.com>
AuthorDate: Thu May 14 08:02:37 2020 +0200

    CAMEL-15057: camel-webhook should start/stop delegate endpoint before register webhook.
---
 .../apache/camel/component/webhook/WebhookEndpoint.java | 17 +++++++++++++++--
 1 file changed, 15 insertions(+), 2 deletions(-)

diff --git a/components/camel-webhook/src/main/java/org/apache/camel/component/webhook/WebhookEndpoint.java b/components/camel-webhook/src/main/java/org/apache/camel/component/webhook/WebhookEndpoint.java
index bc1a438..006337c 100644
--- a/components/camel-webhook/src/main/java/org/apache/camel/component/webhook/WebhookEndpoint.java
+++ b/components/camel-webhook/src/main/java/org/apache/camel/component/webhook/WebhookEndpoint.java
@@ -27,6 +27,7 @@ import org.apache.camel.spi.RestConsumerFactory;
 import org.apache.camel.spi.UriEndpoint;
 import org.apache.camel.spi.UriParam;
 import org.apache.camel.support.DefaultEndpoint;
+import org.apache.camel.support.service.ServiceHelper;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -79,9 +80,15 @@ public class WebhookEndpoint extends DefaultEndpoint implements DelegateEndpoint
     }
 
     @Override
+    protected void doInit() throws Exception {
+        super.doInit();
+        ServiceHelper.initService(delegateEndpoint);
+    }
+
+    @Override
     protected void doStart() throws Exception {
         super.doStart();
-
+        ServiceHelper.startService(delegateEndpoint);
         if (configuration.isWebhookAutoRegister()) {
             LOG.info("Registering webhook for endpoint: {}", delegateEndpoint);
             delegateEndpoint.registerWebhook();
@@ -91,11 +98,17 @@ public class WebhookEndpoint extends DefaultEndpoint implements DelegateEndpoint
     @Override
     protected void doStop() throws Exception {
         super.doStop();
-
         if (configuration.isWebhookAutoRegister() && delegateEndpoint != null) {
             LOG.info("Unregistering webhook for endpoint: {}", delegateEndpoint);
             delegateEndpoint.unregisterWebhook();
         }
+        ServiceHelper.stopService(delegateEndpoint);
+    }
+
+    @Override
+    protected void doShutdown() throws Exception {
+        super.doShutdown();
+        ServiceHelper.stopAndShutdownService(delegateEndpoint);
     }
 
     public WebhookConfiguration getConfiguration() {