Package com.sun.sgs.app

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


    /**
     * {@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

        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

            TaskDetail detail = new TaskDetail(task, owner,
                                               System.currentTimeMillis());
            executor.submit(new TaskRunner(detail));
            waitingSize.incrementAndGet();
        } catch (RejectedExecutionException ree) {
            throw new TaskRejectedException("Couldn't schedule task", ree);
        }
    }
View Full Code Here

            executor.schedule(new TaskRunner(detail),
                              startTime - System.currentTimeMillis(),
                              TimeUnit.MILLISECONDS);
            waitingSize.incrementAndGet();
        } catch (RejectedExecutionException ree) {
            throw new TaskRejectedException("Couldn't schedule task", ree);
        }
    }
View Full Code Here

                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

                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

            return RetryTestRunner.class.getName();
        }
        public void run() throws Exception {
            if (! hasRun) {
                hasRun = true;
                throw new TaskRejectedException("test");
            }
            finished = true;
        }
View Full Code Here

            TaskDetail detail = new TaskDetail(task, owner,
                                               System.currentTimeMillis());
            executor.submit(new TaskRunner(detail));
            waitingSize.incrementAndGet();
        } catch (RejectedExecutionException ree) {
            throw new TaskRejectedException("Couldn't schedule task", ree);
        }
    }
View Full Code Here

            executor.schedule(new TaskRunner(detail),
                              startTime - System.currentTimeMillis(),
                              TimeUnit.MILLISECONDS);
            waitingSize.incrementAndGet();
        } catch (RejectedExecutionException ree) {
            throw new TaskRejectedException("Couldn't schedule task", ree);
        }
    }
View Full Code Here

TOP

Related Classes of com.sun.sgs.app.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.