Package org.springframework.core.task

Examples of org.springframework.core.task.TaskRejectedException


    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


      ListenableFutureTask<Object> future = new ListenableFutureTask<Object>(task, null);
      executor.execute(future);
      return future;
    }
    catch (RejectedExecutionException ex) {
      throw new TaskRejectedException("Executor [" + executor + "] did not accept task: " + task, ex);
    }
  }
View Full Code Here

      ListenableFutureTask<T> future = new ListenableFutureTask<T>(task);
      executor.execute(future);
      return future;
    }
    catch (RejectedExecutionException ex) {
      throw new TaskRejectedException("Executor [" + executor + "] did not accept task: " + task, ex);
    }
  }
View Full Code Here

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

    ExecutorService executor = getScheduledExecutor();
    try {
      return executor.submit(errorHandlingTask(task, false));
    }
    catch (RejectedExecutionException ex) {
      throw new TaskRejectedException("Executor [" + executor + "] did not accept task: " + task, ex);
    }
  }
View Full Code Here

        taskToUse = new DelegatingErrorHandlingCallable<T>(task, this.errorHandler);
      }
      return executor.submit(taskToUse);
    }
    catch (RejectedExecutionException ex) {
      throw new TaskRejectedException("Executor [" + executor + "] did not accept task: " + task, ex);
    }
  }
View Full Code Here

      ListenableFutureTask<Object> future = new ListenableFutureTask<Object>(task, null);
      executor.execute(errorHandlingTask(future, false));
      return future;
    }
    catch (RejectedExecutionException ex) {
      throw new TaskRejectedException("Executor [" + executor + "] did not accept task: " + task, ex);
    }
  }
View Full Code Here

      ListenableFutureTask<T> future = new ListenableFutureTask<T>(task);
      executor.execute(errorHandlingTask(future, false));
      return future;
    }
    catch (RejectedExecutionException ex) {
      throw new TaskRejectedException("Executor [" + executor + "] 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, executor, errorHandler).schedule();
    }
    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.schedule(errorHandlingTask(task, false), initialDelay, TimeUnit.MILLISECONDS);
    }
    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.