* task and run it, throwing any exceptions raised by the task. Note
* that if {@code isTaskAvailable} returns {@code false} then this
* method will simply return without running anything.
*/
void run() throws Exception {
Task actualTask = null;
try {
actualTask = (task != null) ? task : taskRef.get();
} catch (ObjectNotFoundException onfe) {
// This only happens when the application removed the task
// object but didn't cancel the task, so we're done
return;
}
actualTask.run();
}