[jboss-cvs] JBossAS SVN: r64901 - branches/Branch_4_2/connector/src/main/org/jboss/resource/adapter/jms/inflow/dlq.

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Tue Aug 28 04:54:10 EDT 2007


Author: adrian at jboss.org
Date: 2007-08-28 04:54:10 -0400 (Tue, 28 Aug 2007)
New Revision: 64901

Modified:
   branches/Branch_4_2/connector/src/main/org/jboss/resource/adapter/jms/inflow/dlq/AbstractDLQHandler.java
Log:
[JBAS-4625] - Also required in the DLQ

Modified: branches/Branch_4_2/connector/src/main/org/jboss/resource/adapter/jms/inflow/dlq/AbstractDLQHandler.java
===================================================================
--- branches/Branch_4_2/connector/src/main/org/jboss/resource/adapter/jms/inflow/dlq/AbstractDLQHandler.java	2007-08-28 02:06:37 UTC (rev 64900)
+++ branches/Branch_4_2/connector/src/main/org/jboss/resource/adapter/jms/inflow/dlq/AbstractDLQHandler.java	2007-08-28 08:54:10 UTC (rev 64901)
@@ -135,10 +135,28 @@
          connection = qcf.createQueueConnection(user, pass);
       else
          connection = qcf.createQueueConnection();
-      if (clientID != null)
-         connection.setClientID(clientID);
-      connection.setExceptionListener(this);
-      log.debug("Using queue connection " + connection);
+      try
+      {
+         if (clientID != null)
+            connection.setClientID(clientID);
+         connection.setExceptionListener(this);
+         log.debug("Using queue connection " + connection);
+      }
+      catch (Throwable t)
+      {
+         try
+         {
+            connection.close();
+         }
+         catch (Exception e)
+         {
+            log.trace("Ignored error closing connection", e);
+         }
+         connection = null;
+         if (t instanceof Exception)
+            throw (Exception) t;
+         throw new RuntimeException("Error configuring queue connection", t);
+      }
    }
 
    /**
@@ -158,6 +176,7 @@
       {
          log.debug("Error closing the connection " + connection, t);
       }
+      connection = null;
    }
    
    /**




More information about the jboss-cvs-commits mailing list