Exemple #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);
   }
 }
Exemple #2
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);
   }
 }