Example #1
0
 private void doSeveralSteps() throws InterruptedException {
   stepNumber++;
   // add your code here - добавь код тут
   long sleepTime = (long) (1000 / owner.getSpeed());
   Thread.sleep(sleepTime);
   System.out.println(owner.getName() + " делает шаг №" + stepNumber + "!");
 }
Example #2
0
 private void doSeveralSteps() throws InterruptedException {
   stepNumber++;
   // add your code here - добавь код тут
   System.out.println(owner.getName() + " делает шаг №" + stepNumber + "!");
   long timerDream = 1000;
   this.sleep(timerDream / (long) owner.getSpeed());
 }
 @GenerateLink(rel = Constants.LINK_REL_RUNNER_STATE)
 @GET
 @Path("state")
 @Produces(MediaType.APPLICATION_JSON)
 public RunnerState getRunnerState(
     @Required @Description("Name of the runner") @QueryParam("runner") String runner)
     throws Exception {
   final Runner myRunner = getRunner(runner);
   return DtoFactory.getInstance()
       .createDto(RunnerState.class)
       .withName(myRunner.getName())
       .withStats(myRunner.getStats())
       .withServerState(getServerState());
 }
 @GenerateLink(rel = Constants.LINK_REL_AVAILABLE_RUNNERS)
 @GET
 @Path("available")
 @Produces(MediaType.APPLICATION_JSON)
 public List<RunnerDescriptor> getAvailableRunners() {
   final Set<Runner> all = runners.getAll();
   final List<RunnerDescriptor> list = new LinkedList<>();
   final DtoFactory dtoFactory = DtoFactory.getInstance();
   for (Runner runner : all) {
     list.add(
         dtoFactory
             .createDto(RunnerDescriptor.class)
             .withName(runner.getName())
             .withDescription(runner.getDescription())
             .withEnvironments(runner.getEnvironments()));
   }
   return list;
 }
Example #5
0
 private void doSeveralSteps() throws InterruptedException {
   stepNumber++;
   System.out.println(owner.getName() + " делает шаг №" + stepNumber + "!");
   Thread.sleep((long) (1000 / owner.getSpeed()));
 }