Package org.springframework.core.task

Examples of org.springframework.core.task.TaskRejectedException


    Executor executor = getThreadPoolExecutor();
    try {
      executor.execute(task);
    }
    catch (RejectedExecutionException ex) {
      throw new TaskRejectedException("Executor [" + executor + "] did not accept task: " + task, ex);
    }
  }
View Full Code Here


  public void execute(Runnable task) {
    try {
      this.concurrentExecutor.execute(task);
    }
    catch (RejectedExecutionException ex) {
      throw new TaskRejectedException(
          "Executor [" + this.concurrentExecutor + "] did not accept task: " + task, ex);
    }
  }
View Full Code Here

        ErrorHandler errorHandler = (this.errorHandler != null ? this.errorHandler : TaskUtils.getDefaultErrorHandler(true));
        return new ReschedulingRunnable(task, trigger, this.scheduledExecutor, errorHandler).schedule();
      }
    }
    catch (RejectedExecutionException ex) {
      throw new TaskRejectedException("Executor [" + this.scheduledExecutor + "] did not accept task: " + task, ex);
    }
  }
View Full Code Here

    long initialDelay = startTime.getTime() - System.currentTimeMillis();
    try {
      return this.scheduledExecutor.schedule(decorateTask(task, false), initialDelay, TimeUnit.MILLISECONDS);
    }
    catch (RejectedExecutionException ex) {
      throw new TaskRejectedException("Executor [" + this.scheduledExecutor + "] did not accept task: " + task, ex);
    }
  }
View Full Code Here

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

  public ScheduledFuture<?> scheduleAtFixedRate(Runnable task, long period) {
    try {
      return this.scheduledExecutor.scheduleAtFixedRate(decorateTask(task, true), 0, period, TimeUnit.MILLISECONDS);
    }
    catch (RejectedExecutionException ex) {
      throw new TaskRejectedException("Executor [" + this.scheduledExecutor + "] did not accept task: " + task, ex);
    }
  }
View Full Code Here

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

  public ScheduledFuture<?> scheduleWithFixedDelay(Runnable task, long delay) {
    try {
      return this.scheduledExecutor.scheduleWithFixedDelay(decorateTask(task, true), 0, delay, TimeUnit.MILLISECONDS);
    }
    catch (RejectedExecutionException ex) {
      throw new TaskRejectedException("Executor [" + this.scheduledExecutor + "] did not accept task: " + task, ex);
    }
  }
View Full Code Here

    Executor executor = getThreadPoolExecutor();
    try {
      executor.execute(task);
    }
    catch (RejectedExecutionException ex) {
      throw new TaskRejectedException("Executor [" + executor + "] did not accept task: " + task, ex);
    }
  }
View Full Code Here

    ExecutorService executor = getThreadPoolExecutor();
    try {
      return executor.submit(task);
    }
    catch (RejectedExecutionException ex) {
      throw new TaskRejectedException("Executor [" + executor + "] did not accept task: " + task, ex);
    }
  }
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.