private void nextPass(final ActiveContext activeContext) {
   try {
     activeContext.submitTask(
         TaskConfiguration.CONF
             .set(TaskConfiguration.IDENTIFIER, "StatePassing-" + pass)
             .set(TaskConfiguration.TASK, StatePassingTask.class)
             .build());
     ++pass;
   } catch (final BindException e) {
     throw new RuntimeException(e);
   }
 }
示例#2
0
 @Override
 public void onNext(final ActiveContext context) {
   checkMsgOrder(context);
   try {
     context.submitTask(
         TaskConfiguration.CONF
             .set(TaskConfiguration.IDENTIFIER, "FailTask_" + context.getId())
             .set(TaskConfiguration.TASK, NoopTask.class)
             .set(TaskConfiguration.ON_MESSAGE, NoopTask.DriverMessageHandler.class)
             .set(TaskConfiguration.ON_SUSPEND, NoopTask.TaskSuspendHandler.class)
             .set(TaskConfiguration.ON_CLOSE, NoopTask.TaskCloseHandler.class)
             .set(TaskConfiguration.ON_TASK_STOP, NoopTask.TaskStopHandler.class)
             .set(TaskConfiguration.ON_SEND_MESSAGE, NoopTask.class)
             .build());
   } catch (final BindException ex) {
     LOG.log(Level.WARNING, "Task configuration error", ex);
     throw new RuntimeException(ex);
   }
 }
示例#3
0
 @Override
 public void onNext(final SuspendedTask suspendedTask) {
   checkMsgOrder(suspendedTask);
   state = DriverState.RESUME;
   try {
     suspendedTask
         .getActiveContext()
         .submitTask(
             TaskConfiguration.CONF
                 .set(TaskConfiguration.IDENTIFIER, suspendedTask.getId() + "_RESUMED")
                 .set(TaskConfiguration.TASK, NoopTask.class)
                 .set(TaskConfiguration.ON_MESSAGE, NoopTask.DriverMessageHandler.class)
                 .set(TaskConfiguration.ON_SUSPEND, NoopTask.TaskSuspendHandler.class)
                 .set(TaskConfiguration.ON_CLOSE, NoopTask.TaskCloseHandler.class)
                 .set(TaskConfiguration.ON_TASK_STOP, NoopTask.TaskStopHandler.class)
                 .set(TaskConfiguration.ON_SEND_MESSAGE, NoopTask.class)
                 .set(TaskConfiguration.MEMENTO, DatatypeConverter.printBase64Binary(HELLO_STR))
                 .build());
   } catch (final BindException ex) {
     LOG.log(Level.SEVERE, "Task configuration error", ex);
     throw new DriverSideFailure("Task configuration error", ex);
   }
 }