示例#1
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);
   }
 }
示例#2
0
 @Override
 public void onNext(final SuspendedTask task) {
   checkMsgOrder(task);
   state = DriverState.RESUME;
   try {
     task.getActiveContext()
         .submitTask(
             TaskConfiguration.CONF
                 .set(TaskConfiguration.IDENTIFIER, task.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);
   }
 }