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 2008/10/18 11:33:21 UTC

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

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);