[jboss-remoting-commits] JBoss Remoting SVN: r4972 - remoting2/branches/2.x/src/main/org/jboss/remoting.

jboss-remoting-commits at lists.jboss.org jboss-remoting-commits at lists.jboss.org
Sun Apr 12 01:33:53 EDT 2009


Author: ron.sigal at jboss.com
Date: 2009-04-12 01:33:53 -0400 (Sun, 12 Apr 2009)
New Revision: 4972

Modified:
   remoting2/branches/2.x/src/main/org/jboss/remoting/LeasePinger.java
Log:
JBREM-1111: Wrapped timer.schedule() in try/catch in case Timer has shut itself down and needs to be recreated.

Modified: remoting2/branches/2.x/src/main/org/jboss/remoting/LeasePinger.java
===================================================================
--- remoting2/branches/2.x/src/main/org/jboss/remoting/LeasePinger.java	2009-04-12 02:16:28 UTC (rev 4971)
+++ remoting2/branches/2.x/src/main/org/jboss/remoting/LeasePinger.java	2009-04-12 05:33:53 UTC (rev 4972)
@@ -96,7 +96,17 @@
       if(trace) { log.trace(this + " starting lease timer with ping period of " + pingPeriod); }
 
       timerTask = new LeaseTimerTask(this);
-      timer.schedule(timerTask, pingPeriod, pingPeriod);
+
+      try
+      {
+         timer.schedule(timerTask, pingPeriod, pingPeriod);
+      }
+      catch (IllegalStateException e)
+      {
+         log.debug("Unable to schedule TimerTask on existing Timer", e);
+         timer = new Timer(true);
+         timer.schedule(timerTask, pingPeriod, pingPeriod);
+      }
    }
 
    public void stopPing()




More information about the jboss-remoting-commits mailing list