/** * start work * * @param e workEvent */ @Override public void workStarted(WorkEvent e) { if (e.getType() != WorkEvent.WORK_STARTED) fail("Wrong started type"); if (callbackCount != null) { synchronized (this) { callbackCount.setStartCount(callbackCount.getStartCount() + 1); } } super.workStarted(e); }
/** * complete work * * @param e workEvent */ @Override public void workCompleted(WorkEvent e) { if (e.getType() != WorkEvent.WORK_COMPLETED) fail("Wrong completed type"); if (callbackCount != null) { synchronized (this) { callbackCount.setCompletedCount(callbackCount.getCompletedCount() + 1); } } super.workCompleted(e); }
/** * accept work * * @param e workEvent */ @Override public void workAccepted(WorkEvent e) { if (e.getType() != WorkEvent.WORK_ACCEPTED) fail("Wrong accepted type"); source = e.getSource(); work = e.getWork(); startDuration = e.getStartDuration(); exception = e.getException(); if (callbackCount != null) { synchronized (this) { callbackCount.setAcceptCount(callbackCount.getAcceptCount() + 1); } } super.workAccepted(e); }