Proper logging when TimerTask fails

This commit is contained in:
Trustin Lee 2009-01-20 04:39:11 +00:00
parent 69b4817415
commit 546ac3260c

View File

@ -32,6 +32,8 @@ import java.util.concurrent.TimeUnit;
import java.util.concurrent.locks.ReadWriteLock; import java.util.concurrent.locks.ReadWriteLock;
import java.util.concurrent.locks.ReentrantReadWriteLock; import java.util.concurrent.locks.ReentrantReadWriteLock;
import org.jboss.netty.logging.InternalLogger;
import org.jboss.netty.logging.InternalLoggerFactory;
import org.jboss.netty.util.ExecutorUtil; import org.jboss.netty.util.ExecutorUtil;
import org.jboss.netty.util.MapBackedSet; import org.jboss.netty.util.MapBackedSet;
@ -42,6 +44,9 @@ import org.jboss.netty.util.MapBackedSet;
*/ */
public class HashedWheelTimer implements Timer { public class HashedWheelTimer implements Timer {
static final InternalLogger logger =
InternalLoggerFactory.getInstance(HashedWheelTimer.class);
private final Executor executor; private final Executor executor;
private final Worker worker = new Worker(); private final Worker worker = new Worker();
@ -367,7 +372,9 @@ public class HashedWheelTimer implements Timer {
try { try {
task.run(this); task.run(this);
} catch (Throwable t) { } catch (Throwable t) {
// FIXME log the exception logger.warn(
"An exception was thrown by " +
TimerTask.class.getSimpleName() + ".", t);
} }
} }