If we encounter an error posting ourselves to a run-queue when we expire, log

something useful.


git-svn-id: https://samskivert.googlecode.com/svn/trunk@2292 6335cc39-0255-0410-8fd6-9bcaacd3b74c
This commit is contained in:
mdb
2008-04-08 01:20:55 +00:00
parent ef15c874fa
commit e4eed9d775
+9 -4
View File
@@ -22,8 +22,9 @@ package com.samskivert.util;
import java.util.Timer;
import java.util.TimerTask;
import java.util.logging.Level;
import com.samskivert.Log;
import static com.samskivert.Log.log;
/**
* An interface for doing operations after some delay. Allows expiration to occur on a specific
@@ -154,8 +155,7 @@ public abstract class Interval
try {
expired();
} catch (Throwable t) {
Log.warning("Interval broken in expired(): " + t);
Log.logStackTrace(t);
log.log(Level.WARNING, "Interval broken in expired() " + this, t);
}
} else {
@@ -203,7 +203,12 @@ public abstract class Interval
}
};
}
_runQueue.postRunnable(_runner);
try {
_runQueue.postRunnable(_runner);
} catch (Exception e) {
log.log(Level.WARNING, "Failed to execute interval on run-queue " +
"[queue=" + _runQueue + ", interval=" + Interval.this + "].", e);
}
}
}