You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@uima.apache.org by cw...@apache.org on 2009/11/11 21:39:25 UTC

svn commit: r835052 - /incubator/uima/uima-as/trunk/uimaj-as-activemq/src/main/java/org/apache/uima/adapter/jms/activemq/JmsOutputChannel.java

Author: cwiklik
Date: Wed Nov 11 20:39:25 2009
New Revision: 835052

URL: http://svn.apache.org/viewvc?rev=835052&view=rev
Log:
UIMA-1459 throw exception if connection entry in getEndpointConnection() is null

Modified:
    incubator/uima/uima-as/trunk/uimaj-as-activemq/src/main/java/org/apache/uima/adapter/jms/activemq/JmsOutputChannel.java

Modified: incubator/uima/uima-as/trunk/uimaj-as-activemq/src/main/java/org/apache/uima/adapter/jms/activemq/JmsOutputChannel.java
URL: http://svn.apache.org/viewvc/incubator/uima/uima-as/trunk/uimaj-as-activemq/src/main/java/org/apache/uima/adapter/jms/activemq/JmsOutputChannel.java?rev=835052&r1=835051&r2=835052&view=diff
==============================================================================
--- incubator/uima/uima-as/trunk/uimaj-as-activemq/src/main/java/org/apache/uima/adapter/jms/activemq/JmsOutputChannel.java (original)
+++ incubator/uima/uima-as/trunk/uimaj-as-activemq/src/main/java/org/apache/uima/adapter/jms/activemq/JmsOutputChannel.java Wed Nov 11 20:39:25 2009
@@ -417,11 +417,6 @@
     BrokerConnectionEntry brokerConnectionEntry = null;
     if (connectionMap.containsKey(anEndpoint.getServerURI())) {
       brokerConnectionEntry = (BrokerConnectionEntry) connectionMap.get(anEndpoint.getServerURI());
-      brokerConnectionEntry.setBrokerURL(anEndpoint.getServerURI());
-      if ( JmsEndpointConnection_impl.connectionClosedOrFailed(brokerConnectionEntry) ) {
-        invalidateConnectionAndEndpoints(brokerConnectionEntry);
-        brokerConnectionEntry = createConnectionEntry(anEndpoint.getServerURI());
-      }
       // Findbugs thinks that the above may return null, perhaps due to a race condition. Add
       // the null check just in case
       if (brokerConnectionEntry == null) {
@@ -429,6 +424,11 @@
                 + getAnalysisEngineController().getComponentName()
                 + " Unable to Lookup Broker Connection For URL:" + anEndpoint.getServerURI());
       } 
+      brokerConnectionEntry.setBrokerURL(anEndpoint.getServerURI());
+      if ( JmsEndpointConnection_impl.connectionClosedOrFailed(brokerConnectionEntry) ) {
+        invalidateConnectionAndEndpoints(brokerConnectionEntry);
+        brokerConnectionEntry = createConnectionEntry(anEndpoint.getServerURI());
+      }
     } else {
       brokerConnectionEntry = createConnectionEntry(anEndpoint.getServerURI());
     }