Package com.sun.sgs.app

Examples of com.sun.sgs.app.TaskManager


        try {
            Thread.sleep(500L);
        } catch (InterruptedException e) {
            //ignore
        }
  TaskManager taskManager = AppContext.getTaskManager();
  taskManager.schedulePeriodicTask(new MyTask(), 0, 2000);
    }
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

     * <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

   
    @Test
    public void testGetTaskManagerAfterInit() {
        initStableAppContext();
        InternalContext.setManagerLocator(managerLocator);
        TaskManager t = AppContext.getTaskManager();
       
        Assert.assertSame(t, taskManager);
    }
View Full Code Here

    @Test
    public void testGetTaskManagerWithUnstableManagerLocator() {
        initUnstableAppContext();
        InternalContext.setManagerLocator(managerLocator);
       
        TaskManager t1 = AppContext.getTaskManager();
        TaskManager t2 = AppContext.getTaskManager();
       
        Assert.assertSame(t1, taskManager);
        Assert.assertNull(t2);
    }
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

    // 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

        } catch (MissingResourceException mre) {
            dm = null;
        }
        dataManager = dm;
       
        TaskManager tm;
        try {
            tm = managerComponents.getComponent(TaskManager.class);
        } catch (MissingResourceException mre) {
            tm = null;
        }
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.