code: @Override
      public final void stop() {
          if (DynamicTasks.getTaskQueuingContext() != null) {
              doStop();
          } else {
              Task<?> task = Tasks.builder().name("stop").body(new Runnable() {
                  public void run() {
                      doStop();
                  }
              }).build();
              Entities.submit(this, task).getUnchecked();
          }
      }
docs: If custom behaviour is required by sub-classes, consider overriding {@link #doStop()}.