You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@servicemix.apache.org by gn...@apache.org on 2006/03/22 10:14:34 UTC

svn commit: r387803 - /incubator/servicemix/trunk/servicemix-core/src/main/java/org/apache/servicemix/jbi/nmr/flow/AbstractFlow.java

Author: gnodet
Date: Wed Mar 22 01:14:31 2006
New Revision: 387803

URL: http://svn.apache.org/viewcvs?rev=387803&view=rev
Log:
Throw a meaningfull exception instead of NPE when sending a message to a shutdown component

Modified:
    incubator/servicemix/trunk/servicemix-core/src/main/java/org/apache/servicemix/jbi/nmr/flow/AbstractFlow.java

Modified: incubator/servicemix/trunk/servicemix-core/src/main/java/org/apache/servicemix/jbi/nmr/flow/AbstractFlow.java
URL: http://svn.apache.org/viewcvs/incubator/servicemix/trunk/servicemix-core/src/main/java/org/apache/servicemix/jbi/nmr/flow/AbstractFlow.java?rev=387803&r1=387802&r2=387803&view=diff
==============================================================================
--- incubator/servicemix/trunk/servicemix-core/src/main/java/org/apache/servicemix/jbi/nmr/flow/AbstractFlow.java (original)
+++ incubator/servicemix/trunk/servicemix-core/src/main/java/org/apache/servicemix/jbi/nmr/flow/AbstractFlow.java Wed Mar 22 01:14:31 2006
@@ -24,7 +24,6 @@
 import javax.management.JMException;
 import javax.management.MBeanAttributeInfo;
 import javax.management.ObjectName;
-import javax.xml.namespace.QName;
 
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
@@ -168,7 +167,11 @@
         //As the MessageExchange could come from another container - ensure we get the local Component
         ComponentMBeanImpl lcc = broker.getRegistry().getComponent(id.getName());
         if (lcc != null) {
-            lcc.getDeliveryChannel().processInBound(me);
+            if (lcc.getDeliveryChannel() != null) {
+                lcc.getDeliveryChannel().processInBound(me);
+            } else {
+                throw new MessagingException("Component " + id.getName() + " is shut down");
+            }
         }
         else {
             throw new MessagingException("No component named " + id.getName() + " - Couldn't route MessageExchange " + me);