camel-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From davscl...@apache.org
Subject svn commit: r705866 - /activemq/camel/trunk/components/camel-spring/src/main/java/org/apache/camel/component/event/EventEndpoint.java
Date Sat, 18 Oct 2008 09:33:21 GMT
Author: davsclaus
Date: Sat Oct 18 02:33:21 2008
New Revision: 705866

URL: http://svn.apache.org/viewvc?rev=705866&view=rev
Log:
CAMEL-994: ApplicationContext should be set

Modified:
    activemq/camel/trunk/components/camel-spring/src/main/java/org/apache/camel/component/event/EventEndpoint.java

Modified: activemq/camel/trunk/components/camel-spring/src/main/java/org/apache/camel/component/event/EventEndpoint.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/components/camel-spring/src/main/java/org/apache/camel/component/event/EventEndpoint.java?rev=705866&r1=705865&r2=705866&view=diff
==============================================================================
--- activemq/camel/trunk/components/camel-spring/src/main/java/org/apache/camel/component/event/EventEndpoint.java
(original)
+++ activemq/camel/trunk/components/camel-spring/src/main/java/org/apache/camel/component/event/EventEndpoint.java
Sat Oct 18 02:33:21 2008
@@ -30,6 +30,7 @@
 import org.springframework.context.ApplicationEvent;
 
 import static org.apache.camel.util.ObjectHelper.wrapRuntimeCamelException;
+
 /**
  * An <a href="http://activemq.apache.org/camel/event.html">Event Endpoint</a>
  * for working with Spring ApplicationEvents
@@ -62,6 +63,9 @@
     }
 
     public Producer<Exchange> createProducer() throws Exception {
+        if (applicationContext == null) {
+            throw new IllegalStateException("ApplicationContext is null");
+        }
         return new DefaultProducer<Exchange>(this) {
             public void process(Exchange exchange) throws Exception {
                 ApplicationEvent event = toApplicationEvent(exchange);



Mime
View raw message