[jboss-remoting-commits] JBoss Remoting SVN: r5114 - remoting2/branches/2.2/src/main/org/jboss/remoting/detection.

jboss-remoting-commits at lists.jboss.org jboss-remoting-commits at lists.jboss.org
Fri May 1 15:51:03 EDT 2009


Author: ron.sigal at jboss.com
Date: 2009-05-01 15:51:03 -0400 (Fri, 01 May 2009)
New Revision: 5114

Modified:
   remoting2/branches/2.2/src/main/org/jboss/remoting/detection/AbstractDetector.java
Log:
JBREM-1125: Tests for IllegalStateException when scheduling on heartbeatTimer.

Modified: remoting2/branches/2.2/src/main/org/jboss/remoting/detection/AbstractDetector.java
===================================================================
--- remoting2/branches/2.2/src/main/org/jboss/remoting/detection/AbstractDetector.java	2009-05-01 04:51:34 UTC (rev 5113)
+++ remoting2/branches/2.2/src/main/org/jboss/remoting/detection/AbstractDetector.java	2009-05-01 19:51:03 UTC (rev 5114)
@@ -358,7 +358,17 @@
       {
          heartbeatTimer = new Timer(false);
       }
-      heartbeatTimer.schedule(new Heartbeat(), delay, period);
+
+      try
+      {
+         heartbeatTimer.schedule(new Heartbeat(), delay, period);
+      }
+      catch (IllegalStateException e)
+      {
+         log.debug("Unable to schedule TimerTask on existing Timer", e);
+         heartbeatTimer = new Timer(false);
+         heartbeatTimer.schedule(new Heartbeat(), delay, period);
+      }
    }
 
    /**




More information about the jboss-remoting-commits mailing list