Package com.sun.sgs.app

Examples of com.sun.sgs.app.TaskManager


            // schedule tasks to handle up to count operations
            if (!(opsRef.get().isTaskRunning())) {
                opsRef.get().setTaskRunning(true);

                TaskManager tm = AppContext.getTaskManager();
                tm.scheduleTask(new SharedListRevalidateTask(sender, clientID,
                                                             count, opsRef));
            }
        }
View Full Code Here


            // schedule a task to handle more
            if (size - num > 0) {
                logger.fine("Continue " + (size - num) + " remaining tasks " +
                            " with count " + count);

                TaskManager tm = AppContext.getTaskManager();
                tm.scheduleTask(new SharedListRevalidateTask(sender, clientID,
                                                             count, opsRef));
            } else {
                logger.fine("Done running task");
                opsRef.get().setTaskRunning(false);
            }
View Full Code Here

     * <p>
     * Runs the task {@value #DELAY_MS} ms from now,
     * repeating every {@value #PERIOD_MS} ms.
     */
    public void initialize(Properties props) {
        TaskManager taskManager = AppContext.getTaskManager();
        taskManager.schedulePeriodicTask(this, DELAY_MS, PERIOD_MS);
    }
View Full Code Here

     * <p>
     * Runs the task {@value #DELAY_MS} ms from now,
     * repeating every {@value #PERIOD_MS} ms.
     */
    public void initialize(Properties props) {
        TaskManager taskManager = AppContext.getTaskManager();
        taskManager.schedulePeriodicTask(this, DELAY_MS, PERIOD_MS);
    }
View Full Code Here

     */
    public void initialize(Properties props) {
        // Hold onto the task (as a managed reference)
        setSubTask(new TrivialTimedTask());

        TaskManager taskManager = AppContext.getTaskManager();
        taskManager.schedulePeriodicTask(this, DELAY_MS, PERIOD_MS);
    }
View Full Code Here

    public void initialize(Properties props) {
        TrivialTimedTask task = new TrivialTimedTask();

        logger.log(Level.INFO, "Created task: {0}", task);

        TaskManager taskManager = AppContext.getTaskManager();
        taskManager.schedulePeriodicTask(task, DELAY_MS, PERIOD_MS);
    }
View Full Code Here

     * the actual removal in a separate task to avoid scaling problems.
     */
    private void removeChildrenAndEntries() {
  AppContext.getDataManager().markForUpdate(this);
  modifications++;
  TaskManager taskManager = AppContext.getTaskManager();
  if (isLeafNode()) {
      taskManager.scheduleTask(new RemoveNodeEntriesTask(this));
      table = null;
  } else {
            taskManager.scheduleTask(new RemoveNodesTask<K, V>(this));
      nodeDirectory = null;
  }
    }
View Full Code Here

        } catch (MissingResourceException mre) {
            dm = null;
        }
        dataManager = dm;
       
        TaskManager tm;
        try {
            tm = managerComponents.getComponent(TaskManager.class);
        } catch (MissingResourceException mre) {
            tm = null;
        }
View Full Code Here

     * the actual removal in a separate task to avoid scaling problems.
     */
    private void removeChildrenAndEntries() {
  AppContext.getDataManager().markForUpdate(this);
  modifications++;
  TaskManager taskManager = AppContext.getTaskManager();
  if (isLeafNode()) {
      taskManager.scheduleTask(new RemoveNodeEntriesTask(this));
      table = null;
  } else {
            taskManager.scheduleTask(new RemoveNodesTask<K, V>(this));
      nodeDirectory = null;
  }
    }
View Full Code Here

    // Saved messages no longer exist, so "cancel" periodic task.
    return;
      } else {
    // Remove messages saved past their expiration time.
    DataService dataService = getDataService();
    TaskManager taskManager = AppContext.getTaskManager();
    Iterator<ChannelMessageInfo> iter =
        savedMessages.values().iterator();
    while (taskManager.shouldContinue() && iter.hasNext()) {
        ChannelMessageInfo messageInfo = iter.next();
        if (messageInfo.isExpired()) {
      if (logger.isLoggable(Level.FINEST)) {
          logger.log(
        Level.FINEST,
View Full Code Here

TOP

Related Classes of com.sun.sgs.app.TaskManager

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.