Examples of TaskRejectedException


Examples of com.sun.sgs.app.TaskRejectedException

                long delay = taskDetail.startTime - System.currentTimeMillis();
                executor.schedule(new TaskRunner(taskDetail), delay,
                                  TimeUnit.MILLISECONDS);
                waitingSize.incrementAndGet();
            } catch (RejectedExecutionException ree) {
                throw new TaskRejectedException("The system has run out of " +
                                                "resources and cannot run " +
                                                "the requested task", ree);
            }
        }
View Full Code Here

Examples of com.sun.sgs.app.TaskRejectedException

                future =
                    executor.scheduleAtFixedRate(new TaskRunner(taskDetail),
                                                 delay, taskDetail.period,
                                                 TimeUnit.MILLISECONDS);
            } catch (RejectedExecutionException ree) {
                throw new TaskRejectedException("The system has run out of " +
                                                "resources and cannot start " +
                                                "the requested task", ree);
            }
        }
View Full Code Here

Examples of com.sun.sgs.app.TaskRejectedException

    /**
     * {@inheritDoc}
     */
    public TaskReservation reserveTask(ScheduledTask task) {
        if (task.isRecurring()) {
            throw new TaskRejectedException("Recurring tasks cannot get " +
                                            "reservations");
        }

        return new SimpleTaskReservation(this, task);
    }
View Full Code Here

Examples of com.sun.sgs.app.TaskRejectedException

        if (!timedTaskHandler.runDelayed(task)) {
            // check if the task is recurring, because we're not allowed to
            // reject those tasks
            if (!task.isRecurring()) {
                if (!queue.offer(task)) {
                    throw new TaskRejectedException("Request was rejected");
                }
            } else {
                timedTaskReady(task);
            }
        }
View Full Code Here

Examples of com.sun.sgs.app.TaskRejectedException

    /**
     * {@inheritDoc}
     */
    public TaskReservation reserveTask(ScheduledTask task) {
        if (task.isRecurring()) {
            throw new TaskRejectedException("Recurring tasks cannot get " +
                                            "reservations");
        }

        return new SimpleTaskReservation(this, task);
    }
View Full Code Here

Examples of org.springframework.core.task.TaskRejectedException

  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

Examples of org.springframework.core.task.TaskRejectedException

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

Examples of org.springframework.core.task.TaskRejectedException

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

Examples of org.springframework.core.task.TaskRejectedException

      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

Examples of org.springframework.core.task.TaskRejectedException

    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
TOP
Copyright © 2018 www.massapi.com. 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.