servicemix-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gno...@apache.org
Subject svn commit: r470364 - /incubator/servicemix/trunk/servicemix-core/src/main/java/org/apache/servicemix/jbi/view/DotViewFlowListener.java
Date Thu, 02 Nov 2006 13:57:38 GMT
Author: gnodet
Date: Thu Nov  2 05:57:36 2006
New Revision: 470364

URL: http://svn.apache.org/viewvc?view=rev&rev=470364
Log:
Fix possible NPE on DotViewFlowListener

Modified:
    incubator/servicemix/trunk/servicemix-core/src/main/java/org/apache/servicemix/jbi/view/DotViewFlowListener.java

Modified: incubator/servicemix/trunk/servicemix-core/src/main/java/org/apache/servicemix/jbi/view/DotViewFlowListener.java
URL: http://svn.apache.org/viewvc/incubator/servicemix/trunk/servicemix-core/src/main/java/org/apache/servicemix/jbi/view/DotViewFlowListener.java?view=diff&rev=470364&r1=470363&r2=470364
==============================================================================
--- incubator/servicemix/trunk/servicemix-core/src/main/java/org/apache/servicemix/jbi/view/DotViewFlowListener.java
(original)
+++ incubator/servicemix/trunk/servicemix-core/src/main/java/org/apache/servicemix/jbi/view/DotViewFlowListener.java
Thu Nov  2 05:57:36 2006
@@ -36,6 +36,7 @@
 import org.apache.servicemix.jbi.framework.ComponentMBeanImpl;
 import org.apache.servicemix.jbi.framework.Registry;
 import org.apache.servicemix.jbi.messaging.MessageExchangeImpl;
+import org.apache.servicemix.jbi.servicedesc.AbstractServiceEndpoint;
 import org.apache.servicemix.jbi.servicedesc.EndpointSupport;
 
 import edu.emory.mathcs.backport.java.util.concurrent.ConcurrentHashMap;
@@ -139,8 +140,7 @@
     
     public void exchangeSent(ExchangeEvent event) {
         MessageExchange me = event.getExchange();
-        if (me.getEndpoint() != null &&
-            me instanceof MessageExchangeImpl) {
+        if (me.getEndpoint() instanceof AbstractServiceEndpoint && me instanceof
MessageExchangeImpl) {
             MessageExchangeImpl mei = (MessageExchangeImpl) me;
             String source = (String) me.getProperty(JbiConstants.SENDER_ENDPOINT);
             if (source == null) {
@@ -156,7 +156,7 @@
                 }
             }
             usedComponents.add(mei.getSourceId().getName());
-            usedComponents.add(mei.getDestinationId().getName());
+            usedComponents.add(((AbstractServiceEndpoint) mei.getEndpoint()).getComponentNameSpace().getName());
             String dest = EndpointSupport.getUniqueKey(mei.getEndpoint());
             Map componentFlow = createSource(source);
             if (componentFlow.put(dest, Boolean.TRUE) == null) {



Mime
View raw message