@Override public void run() { while (isActive()) { JobMachine.JobEntry job = machine.pollJob(); if (job == null) { continue; } currentJob = job; try { machine.runJobEntry(currentJob); } catch (Throwable ex) { logger.error("unexpected exception: " + ex.getMessage(), ex); } finally { currentJob = null; } } }
public boolean isActive() { return active && machine.isActive(); }