Пример #1
0
 @Override
 public SchedulerJobState nextTransition(SchedulerJobEvent event)
     throws InvalidStateTransitionException {
   switch (event) {
     case ON_DELETE:
       return this;
     default:
       throw new InvalidStateTransitionException(
           "SchedulerJobEvent: "
               + event.name()
               + " is not a valid event for state: "
               + this.name());
   }
 }
Пример #2
0
 @Override
 public SchedulerJobState nextTransition(SchedulerJobEvent event)
     throws InvalidStateTransitionException {
   switch (event) {
     case ON_SUSPEND:
       return this;
     case ON_RESUME:
       return SchedulerJobState.SCHEDULED;
     case ON_EXPIRE:
       return SchedulerJobState.EXPIRED;
     case ON_DELETE:
       return SchedulerJobState.DELETED;
     default:
       throw new InvalidStateTransitionException(
           "SchedulerJobEvent: "
               + event.name()
               + " is not a valid event for state: "
               + this.name());
   }
 }