You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by zr...@apache.org on 2018/10/29 11:00:21 UTC

[camel] branch master updated (aa69311 -> 0d10fad)

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

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


    from aa69311  Upgrade Atmosphere Websocket to version 2.5.1
     new 738476c  CAMEL-12905: The trigger that starts the SpringCamelContext and that collect to routes to the camel context, needs to be a ContextRefreshedEvent that has been emitted by the ApplicationContext that instantiated the SpringCamelContext instance.
     new 3a42f59  12905: No need to cast ContextRefreshedEvent. Safety applicationContext identity check.
     new cfb6c60  12905: Safety applicationContext identity check.
     new 0d10fad  12905 Fixes missing parentheses

The 4 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.


Summary of changes:
 .../src/main/java/org/apache/camel/spring/boot/RoutesCollector.java    | 3 ++-
 .../src/main/java/org/apache/camel/spring/SpringCamelContext.java      | 2 +-
 2 files changed, 3 insertions(+), 2 deletions(-)


[camel] 02/04: 12905: No need to cast ContextRefreshedEvent. Safety applicationContext identity check.

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

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

commit 3a42f597176190df18b4267decc67031dcde921b
Author: Zoran Regvart <zo...@regvart.com>
AuthorDate: Mon Oct 29 11:43:01 2018 +0100

    12905: No need to cast ContextRefreshedEvent. Safety applicationContext identity check.
    
    Co-Authored-By: oalles <oa...@gmail.com>
---
 .../src/main/java/org/apache/camel/spring/boot/RoutesCollector.java     | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/components/camel-spring-boot/src/main/java/org/apache/camel/spring/boot/RoutesCollector.java b/components/camel-spring-boot/src/main/java/org/apache/camel/spring/boot/RoutesCollector.java
index 42167cf..3f951a5 100644
--- a/components/camel-spring-boot/src/main/java/org/apache/camel/spring/boot/RoutesCollector.java
+++ b/components/camel-spring-boot/src/main/java/org/apache/camel/spring/boot/RoutesCollector.java
@@ -84,7 +84,7 @@ public class RoutesCollector implements ApplicationListener<ContextRefreshedEven
         CamelContext camelContext = applicationContext.getBean(CamelContext.class);
 
         // only add and start Camel if its stopped (initial state)
-        if (((ContextRefreshedEvent) event).getApplicationContext().getId().equals(this.applicationContext.getId())
+        if (event.getApplicationContext() == this.applicationContext)
                 && camelContext.getStatus().isStopped()) {
             LOG.debug("Post-processing CamelContext bean: {}", camelContext.getName());
 


[camel] 04/04: 12905 Fixes missing parentheses

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

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

commit 0d10fadbc65a095ddcc31aae1dcb4d0f03decdfa
Author: Omar Alles <oa...@gmail.com>
AuthorDate: Mon Oct 29 11:55:21 2018 +0100

    12905 Fixes missing parentheses
---
 .../src/main/java/org/apache/camel/spring/boot/RoutesCollector.java     | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/components/camel-spring-boot/src/main/java/org/apache/camel/spring/boot/RoutesCollector.java b/components/camel-spring-boot/src/main/java/org/apache/camel/spring/boot/RoutesCollector.java
index 3f951a5..d378e31 100644
--- a/components/camel-spring-boot/src/main/java/org/apache/camel/spring/boot/RoutesCollector.java
+++ b/components/camel-spring-boot/src/main/java/org/apache/camel/spring/boot/RoutesCollector.java
@@ -84,7 +84,7 @@ public class RoutesCollector implements ApplicationListener<ContextRefreshedEven
         CamelContext camelContext = applicationContext.getBean(CamelContext.class);
 
         // only add and start Camel if its stopped (initial state)
-        if (event.getApplicationContext() == this.applicationContext)
+        if (event.getApplicationContext() == this.applicationContext
                 && camelContext.getStatus().isStopped()) {
             LOG.debug("Post-processing CamelContext bean: {}", camelContext.getName());
 


[camel] 03/04: 12905: Safety applicationContext identity check.

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

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

commit cfb6c60804aa35e4638029306bbe6c0ec01720ed
Author: Zoran Regvart <zo...@regvart.com>
AuthorDate: Mon Oct 29 11:43:39 2018 +0100

    12905: Safety applicationContext identity check.
    
    Co-Authored-By: oalles <oa...@gmail.com>
---
 .../src/main/java/org/apache/camel/spring/SpringCamelContext.java       | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/components/camel-spring/src/main/java/org/apache/camel/spring/SpringCamelContext.java b/components/camel-spring/src/main/java/org/apache/camel/spring/SpringCamelContext.java
index 711cbe3..b4dba29 100644
--- a/components/camel-spring/src/main/java/org/apache/camel/spring/SpringCamelContext.java
+++ b/components/camel-spring/src/main/java/org/apache/camel/spring/SpringCamelContext.java
@@ -159,7 +159,7 @@ public class SpringCamelContext extends DefaultCamelContext implements Lifecycle
     public void onApplicationEvent(ApplicationEvent event) {
         LOG.debug("onApplicationEvent: {}", event);
 
-        if (event instanceof ContextRefreshedEvent && ((ContextRefreshedEvent) event).getApplicationContext().getId().equals(this.applicationContext.getId())) {
+        if (event instanceof ContextRefreshedEvent && ((ContextRefreshedEvent) event).getApplicationContext() == this.applicationContext) {
             // nominally we would prefer to use Lifecycle interface that
             // would invoke start() method, but in order to do that 
             // SpringCamelContext needs to implement SmartLifecycle


[camel] 01/04: CAMEL-12905: The trigger that starts the SpringCamelContext and that collect to routes to the camel context, needs to be a ContextRefreshedEvent that has been emitted by the ApplicationContext that instantiated the SpringCamelContext instance.

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

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

commit 738476cc101de0728d61067dee51c9e94baa444c
Author: Omar Alles <oa...@gmail.com>
AuthorDate: Fri Oct 26 23:54:13 2018 +0200

    CAMEL-12905: The trigger that starts the SpringCamelContext and that collect to routes to the camel context, needs to be a ContextRefreshedEvent that has been emitted by the ApplicationContext that instantiated the SpringCamelContext instance.
---
 .../src/main/java/org/apache/camel/spring/boot/RoutesCollector.java    | 3 ++-
 .../src/main/java/org/apache/camel/spring/SpringCamelContext.java      | 2 +-
 2 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/components/camel-spring-boot/src/main/java/org/apache/camel/spring/boot/RoutesCollector.java b/components/camel-spring-boot/src/main/java/org/apache/camel/spring/boot/RoutesCollector.java
index 54f2064..42167cf 100644
--- a/components/camel-spring-boot/src/main/java/org/apache/camel/spring/boot/RoutesCollector.java
+++ b/components/camel-spring-boot/src/main/java/org/apache/camel/spring/boot/RoutesCollector.java
@@ -84,7 +84,8 @@ public class RoutesCollector implements ApplicationListener<ContextRefreshedEven
         CamelContext camelContext = applicationContext.getBean(CamelContext.class);
 
         // only add and start Camel if its stopped (initial state)
-        if (camelContext.getStatus().isStopped()) {
+        if (((ContextRefreshedEvent) event).getApplicationContext().getId().equals(this.applicationContext.getId())
+                && camelContext.getStatus().isStopped()) {
             LOG.debug("Post-processing CamelContext bean: {}", camelContext.getName());
 
             final AntPathMatcher matcher = new AntPathMatcher();
diff --git a/components/camel-spring/src/main/java/org/apache/camel/spring/SpringCamelContext.java b/components/camel-spring/src/main/java/org/apache/camel/spring/SpringCamelContext.java
index e32e581..711cbe3 100644
--- a/components/camel-spring/src/main/java/org/apache/camel/spring/SpringCamelContext.java
+++ b/components/camel-spring/src/main/java/org/apache/camel/spring/SpringCamelContext.java
@@ -159,7 +159,7 @@ public class SpringCamelContext extends DefaultCamelContext implements Lifecycle
     public void onApplicationEvent(ApplicationEvent event) {
         LOG.debug("onApplicationEvent: {}", event);
 
-        if (event instanceof ContextRefreshedEvent) {
+        if (event instanceof ContextRefreshedEvent && ((ContextRefreshedEvent) event).getApplicationContext().getId().equals(this.applicationContext.getId())) {
             // nominally we would prefer to use Lifecycle interface that
             // would invoke start() method, but in order to do that 
             // SpringCamelContext needs to implement SmartLifecycle