Author: ron.sigal(a)jboss.com
Date: 2009-05-01 15:59:09 -0400 (Fri, 01 May 2009)
New Revision: 5116
Modified:
remoting2/branches/2.x/src/main/org/jboss/remoting/detection/AbstractDetector.java
Log:
JBREM-1125: Tests for IllegalStateException when scheduling on heartbeatTimer.
Modified:
remoting2/branches/2.x/src/main/org/jboss/remoting/detection/AbstractDetector.java
===================================================================
---
remoting2/branches/2.x/src/main/org/jboss/remoting/detection/AbstractDetector.java 2009-05-01
19:56:20 UTC (rev 5115)
+++
remoting2/branches/2.x/src/main/org/jboss/remoting/detection/AbstractDetector.java 2009-05-01
19:59:09 UTC (rev 5116)
@@ -367,7 +367,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);
+ }
}
/**
Show replies by date