Package org.springframework.core.task

Examples of org.springframework.core.task.TaskRejectedException


    long initialDelay = startTime.getTime() - System.currentTimeMillis();
    try {
      return executor.scheduleAtFixedRate(errorHandlingTask(task, true), initialDelay, period, TimeUnit.MILLISECONDS);
    }
    catch (RejectedExecutionException ex) {
      throw new TaskRejectedException("Executor [" + executor + "] did not accept task: " + task, ex);
    }
  }
View Full Code Here


    ScheduledExecutorService executor = getScheduledExecutor();
    try {
      return executor.scheduleAtFixedRate(errorHandlingTask(task, true), 0, period, TimeUnit.MILLISECONDS);
    }
    catch (RejectedExecutionException ex) {
      throw new TaskRejectedException("Executor [" + executor + "] did not accept task: " + task, ex);
    }
  }
View Full Code Here

    long initialDelay = startTime.getTime() - System.currentTimeMillis();
    try {
      return executor.scheduleWithFixedDelay(errorHandlingTask(task, true), initialDelay, delay, TimeUnit.MILLISECONDS);
    }
    catch (RejectedExecutionException ex) {
      throw new TaskRejectedException("Executor [" + executor + "] did not accept task: " + task, ex);
    }
  }
View Full Code Here

    ScheduledExecutorService executor = getScheduledExecutor();
    try {
      return executor.scheduleWithFixedDelay(errorHandlingTask(task, true), 0, delay, TimeUnit.MILLISECONDS);
    }
    catch (RejectedExecutionException ex) {
      throw new TaskRejectedException("Executor [" + executor + "] did not accept task: " + task, ex);
    }
  }
View Full Code Here

      semaphore.acquire();
      count.incrementAndGet();
    }
    catch (InterruptedException e) {
      Thread.currentThread().interrupt();
      throw new TaskRejectedException("Task could not be submitted because of a thread interruption.");
    }

    try {
      taskExecutor.execute(new FutureTask<Object>(task, null) {
        @Override
View Full Code Here

    final List<String> list = new ArrayList<String>();
    jobLauncher.setTaskExecutor(new TaskExecutor() {
      @Override
      public void execute(Runnable task) {
        list.add("execute");
        throw new TaskRejectedException("Planned failure");
      }
    });

    JobExecution jobExecution = new JobExecution((JobInstance) null, (JobParameters) null);
View Full Code Here

    handler.setGridSize(2);
    handler.setTaskExecutor(new TaskExecutor() {
      @Override
      public void execute(Runnable task) {
        if (count > 0) {
          throw new TaskRejectedException("foo");
        }
        task.run();
      }
    });
    Collection<StepExecution> executions = handler.handle(stepExecutionSplitter, stepExecution);
View Full Code Here

TOP

Related Classes of org.springframework.core.task.TaskRejectedException

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.