Broke-out the notification that we've been posted to a shutdown RunQueue

into a method, so that it can be suppressed, etc.


git-svn-id: https://samskivert.googlecode.com/svn/trunk@2688 6335cc39-0255-0410-8fd6-9bcaacd3b74c
This commit is contained in:
ray.j.greenwell
2010-01-06 20:16:52 +00:00
parent 838d725bb6
commit 32d01f5651
+12 -4
View File
@@ -263,6 +263,15 @@ public abstract class Interval
} }
} }
/**
* Note (log) that we were unable to be posted to our RunQueue because it is no longer running.
*/
protected void noteRejected ()
{
log.warning("Interval posted to shutdown RunQueue. Cancelling.",
"queue", _runQueue, "interval", this);
}
protected static Timer createTimer () protected static Timer createTimer ()
{ {
return new Timer("samskivert Interval Timer", true); return new Timer("samskivert Interval Timer", true);
@@ -318,13 +327,12 @@ public abstract class Interval
try { try {
ival._runQueue.postRunnable(_runner); ival._runQueue.postRunnable(_runner);
} catch (Exception e) { } catch (Exception e) {
log.warning("Failed to execute interval on run-queue", "queue", ival._runQueue, log.warning("Failed to execute interval on run-queue",
"interval", ival, e); "queue", ival._runQueue, "interval", ival, e);
} }
} else { } else {
log.warning("Interval posted to shutdown RunQueue. Cancelling.", ival.noteRejected();
"queue", ival._runQueue, "interval", ival);
ival.cancel(); ival.cancel();
} }
} }