Пример #1
0
  /**
   * 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);
  }
Пример #2
0
  /**
   * 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);
  }
Пример #3
0
  /**
   * 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);
  }