camel-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From davscl...@apache.org
Subject svn commit: r930219 - in /camel/trunk: camel-core/src/main/java/org/apache/camel/impl/ components/camel-spring/src/main/java/org/apache/camel/spring/ components/camel-spring/src/test/resources/org/apache/camel/spring/ components/camel-spring/src/test/r...
Date Fri, 02 Apr 2010 09:54:38 GMT
Author: davsclaus
Date: Fri Apr  2 09:54:38 2010
New Revision: 930219

URL: http://svn.apache.org/viewvc?rev=930219&view=rev
Log:
CAMEL-2599: CAMEL-2607 fixed the twice events emitted from Spring 3.0, so removing code no
longer needed.

Modified:
    camel/trunk/camel-core/src/main/java/org/apache/camel/impl/DefaultCamelContext.java
    camel/trunk/components/camel-spring/src/main/java/org/apache/camel/spring/CamelContextFactoryBean.java
    camel/trunk/components/camel-spring/src/main/java/org/apache/camel/spring/SpringCamelContext.java
    camel/trunk/components/camel-spring/src/test/resources/org/apache/camel/spring/camelContextFactoryBean.xml
    camel/trunk/components/camel-spring/src/test/resources/org/apache/camel/spring/config/CustomExecutorServiceStrategyTest-context.xml

Modified: camel/trunk/camel-core/src/main/java/org/apache/camel/impl/DefaultCamelContext.java
URL: http://svn.apache.org/viewvc/camel/trunk/camel-core/src/main/java/org/apache/camel/impl/DefaultCamelContext.java?rev=930219&r1=930218&r2=930219&view=diff
==============================================================================
--- camel/trunk/camel-core/src/main/java/org/apache/camel/impl/DefaultCamelContext.java (original)
+++ camel/trunk/camel-core/src/main/java/org/apache/camel/impl/DefaultCamelContext.java Fri
Apr  2 09:54:38 2010
@@ -1374,11 +1374,6 @@ public class DefaultCamelContext extends
         return isStarted() && !isStarting();
     }
 
-    protected void resetFirstStartDone() {
-        // to prevent issue with Spring 3.0 calling ContextRefreshedEvent twice instead of
only once
-        firstStartDone = false;
-    }
-
     public void setDataFormats(Map<String, DataFormatDefinition> dataFormats) {
         this.dataFormats = dataFormats;
     }

Modified: camel/trunk/components/camel-spring/src/main/java/org/apache/camel/spring/CamelContextFactoryBean.java
URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-spring/src/main/java/org/apache/camel/spring/CamelContextFactoryBean.java?rev=930219&r1=930218&r2=930219&view=diff
==============================================================================
--- camel/trunk/components/camel-spring/src/main/java/org/apache/camel/spring/CamelContextFactoryBean.java
(original)
+++ camel/trunk/components/camel-spring/src/main/java/org/apache/camel/spring/CamelContextFactoryBean.java
Fri Apr  2 09:54:38 2010
@@ -197,6 +197,10 @@ public class CamelContextFactoryBean ext
     }
     
     public void afterPropertiesSet() throws Exception {
+        if (ObjectHelper.isEmpty(getId())) {
+            throw new IllegalArgumentException("Id must be set");
+        }
+
         if (properties != null) {
             getContext().setProperties(properties.asMap());
         }

Modified: camel/trunk/components/camel-spring/src/main/java/org/apache/camel/spring/SpringCamelContext.java
URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-spring/src/main/java/org/apache/camel/spring/SpringCamelContext.java?rev=930219&r1=930218&r2=930219&view=diff
==============================================================================
--- camel/trunk/components/camel-spring/src/main/java/org/apache/camel/spring/SpringCamelContext.java
(original)
+++ camel/trunk/components/camel-spring/src/main/java/org/apache/camel/spring/SpringCamelContext.java
Fri Apr  2 09:54:38 2010
@@ -34,7 +34,6 @@ import org.springframework.beans.factory
 import org.springframework.context.ApplicationContext;
 import org.springframework.context.ApplicationContextAware;
 import org.springframework.context.ApplicationEvent;
-import org.springframework.context.ApplicationListener;
 import org.springframework.context.ConfigurableApplicationContext;
 import org.springframework.context.event.ContextRefreshedEvent;
 import org.springframework.context.event.ContextStoppedEvent;
@@ -99,9 +98,6 @@ public class SpringCamelContext extends 
             // now lets start the CamelContext so that all its possible
             // dependencies are initialized
             try {
-                // must reset the first start to handle Spring 3.0 sending
-                // this event twice per camel context instead of only once as in 2.x
-                resetFirstStartDone();
                 maybeStart();
             } catch (Exception e) {
                 throw wrapRuntimeCamelException(e);

Modified: camel/trunk/components/camel-spring/src/test/resources/org/apache/camel/spring/camelContextFactoryBean.xml
URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-spring/src/test/resources/org/apache/camel/spring/camelContextFactoryBean.xml?rev=930219&r1=930218&r2=930219&view=diff
==============================================================================
--- camel/trunk/components/camel-spring/src/test/resources/org/apache/camel/spring/camelContextFactoryBean.xml
(original)
+++ camel/trunk/components/camel-spring/src/test/resources/org/apache/camel/spring/camelContextFactoryBean.xml
Fri Apr  2 09:54:38 2010
@@ -27,6 +27,8 @@
   <!-- START SNIPPET: example1 -->
   <bean id="camel" class="org.apache.camel.spring.CamelContextFactoryBean">
     <property name="packages" value="org.apache.camel.spring.example"/>
+      <!-- must have an id explicit set (it cannot inherit the id from the bean tag) -->
+      <property name="id" value="camel"/>
   </bean>
   <!-- END SNIPPET: example1 -->
 

Modified: camel/trunk/components/camel-spring/src/test/resources/org/apache/camel/spring/config/CustomExecutorServiceStrategyTest-context.xml
URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-spring/src/test/resources/org/apache/camel/spring/config/CustomExecutorServiceStrategyTest-context.xml?rev=930219&r1=930218&r2=930219&view=diff
==============================================================================
--- camel/trunk/components/camel-spring/src/test/resources/org/apache/camel/spring/config/CustomExecutorServiceStrategyTest-context.xml
(original)
+++ camel/trunk/components/camel-spring/src/test/resources/org/apache/camel/spring/config/CustomExecutorServiceStrategyTest-context.xml
Fri Apr  2 09:54:38 2010
@@ -22,7 +22,7 @@
        http://camel.apache.org/schema/spring http://camel.apache.org/schema/spring/camel-spring.xsd
     ">
 
-    <bean id="myCustomPoolStrategy" class="org.apache.camel.spring.config.CustomExecutorServiceStrategy">
+    <bean id="myCustomPoolStrategy" depends-on="camel" class="org.apache.camel.spring.config.CustomExecutorServiceStrategy">
         <constructor-arg index="0" ref="camel"/>
     </bean>
 



Mime
View raw message