Package org.springframework.core.task

Examples of org.springframework.core.task.TaskRejectedException


  public void testIsCheckedException() {
    assertTrue(ObjectUtils.isCheckedException(new Exception()));
    assertTrue(ObjectUtils.isCheckedException(new SQLException()));

    assertFalse(ObjectUtils.isCheckedException(new RuntimeException()));
    assertFalse(ObjectUtils.isCheckedException(new TaskRejectedException("")));

    // Any Throwable other than RuntimeException and Error
    // has to be considered checked according to the JLS.
    assertTrue(ObjectUtils.isCheckedException(new Throwable()));
  }
View Full Code Here


      else {
        this.workManager.schedule(work);
      }
    }
    catch (WorkRejectedException ex) {
      throw new TaskRejectedException("CommonJ WorkManager did not accept task: " + task, ex);
    }
    catch (WorkException ex) {
      throw new SchedulingException("Could not schedule task on CommonJ WorkManager", ex);
    }
  }
View Full Code Here

    catch (WorkRejectedException ex) {
      if (WorkException.START_TIMED_OUT.equals(ex.getErrorCode())) {
        throw new TaskTimeoutException("JCA WorkManager rejected task because of timeout: " + task, ex);
      }
      else {
        throw new TaskRejectedException("JCA WorkManager rejected task: " + task, ex);
      }
    }
    catch (WorkException ex) {
      throw new SchedulingException("Could not schedule task on JCA WorkManager", ex);
    }
View Full Code Here

      else {
        this.workManager.schedule(work);
      }
    }
    catch (WorkRejectedException ex) {
      throw new TaskRejectedException("CommonJ WorkManager did not accept task: " + task, ex);
    }
    catch (WorkException ex) {
      throw new SchedulingException("Could not schedule task on CommonJ WorkManager", 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

    try {
      return this.scheduledExecutor.schedule(
          errorHandlingTask(task, false), initialDelay, 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

    try {
      return this.scheduledExecutor.scheduleAtFixedRate(
          errorHandlingTask(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

    try {
      return this.scheduledExecutor.scheduleAtFixedRate(
          errorHandlingTask(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

    try {
      return this.scheduledExecutor.scheduleWithFixedDelay(
          errorHandlingTask(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

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.