exec = MoreExecutors.listeningDecorator(MoreExecutors.getExitingExecutorService(new ScheduledThreadPoolExecutor(1)));
this.evalFunc = udf;
MonitoredUDF anno = udf.getClass().getAnnotation(MonitoredUDF.class);
timeUnit = anno.timeUnit();
duration = anno.duration();
errorCallback = anno.errorCallback();
// The exceptions really should not happen since our handlers are defined by the parent class which
// must be extended by all custom handlers.
try {
errorHandler = errorCallback.getMethod("handleError", EvalFunc.class, Exception.class);