Beispiel #1
0
 /**
  * Returns true if this timer is active. Else returns false.
  *
  * <p>A timer is considered to be "active", if its {@link TimerState} is neither of the following:
  *
  * <ul>
  *   <li>{@link TimerState#CANCELED}
  *   <li>{@link TimerState#EXPIRED}
  *   <li>has not been suspended
  * </ul>
  *
  * <p>And if the corresponding timer service is still up
  *
  * <p>
  *
  * @return
  */
 public boolean isActive() {
   return timerService.isStarted()
       && !isCanceled()
       && !isExpired()
       && (timerService.isScheduled(getId()) || timerState == TimerState.CREATED);
 }