Package com.sun.sgs.kernel

Examples of com.sun.sgs.kernel.RecurringTaskHandle.start()


        RecurringTaskHandle handle =
            taskScheduler.scheduleRecurringTask(new IncrementRunner(),
                                                taskOwner,
                                                System.currentTimeMillis() + 50,
                                                50);
        handle.start();
        handle.cancel();
        Thread.sleep(200L);
        assertEquals(0, taskCount);
    }
View Full Code Here


        RecurringTaskHandle handle =
            taskScheduler.scheduleRecurringTask(new IncrementRunner(),
                                                taskOwner,
                                                System.currentTimeMillis(),
                                                200);
        handle.start();
        Thread.sleep(300L);
        assertEquals(2, taskCount);
        handle.cancel();
        Thread.sleep(200L);
        assertEquals(2, taskCount);
View Full Code Here

        public void restartRecurringTask() throws Exception {
        RecurringTaskHandle handle =
            taskScheduler.scheduleRecurringTask(testTask, taskOwner,
                                                System.currentTimeMillis(),
                                                100);
        handle.start();
        try {
            handle.start();
        } finally {
            handle.cancel();
        }
View Full Code Here

            taskScheduler.scheduleRecurringTask(testTask, taskOwner,
                                                System.currentTimeMillis(),
                                                100);
        handle.start();
        try {
            handle.start();
        } finally {
            handle.cancel();
        }
    }
View Full Code Here

        RecurringTaskHandle handle =
            taskScheduler.scheduleRecurringTask(testTask, taskOwner,
                                                System.currentTimeMillis(),
                                                100);
        handle.cancel();
        handle.start();
    }

    /**
     * Test createTaskQueue.
     */
 
View Full Code Here

    }

    @Test public void cancelAfterStartRecurringTask() throws Exception {
        RecurringTaskHandle handle =
            getRecurringTask().getRecurringTaskHandle();
        handle.start();
        handle.cancel();
    }

    @Test public void startSleepAndCancelRecurringTask() throws Exception {
        RecurringTaskHandle handle =
View Full Code Here

    }

    @Test public void startSleepAndCancelRecurringTask() throws Exception {
        RecurringTaskHandle handle =
            getRecurringTask().getRecurringTaskHandle();
        handle.start();
        Thread.sleep(200);
        handle.cancel();
    }

    @Test public void cancelRecurringTask() throws Exception {
View Full Code Here

    }

    @Test public void restartRecurringTask() throws Exception {
        RecurringTaskHandle handle =
            getRecurringTask().getRecurringTaskHandle();
        handle.start();
        try {
            handle.start();
            fail("Expected an IllegalStateException");
        } catch(IllegalStateException e) {}
        finally {
View Full Code Here

    @Test public void restartRecurringTask() throws Exception {
        RecurringTaskHandle handle =
            getRecurringTask().getRecurringTaskHandle();
        handle.start();
        try {
            handle.start();
            fail("Expected an IllegalStateException");
        } catch(IllegalStateException e) {}
        finally {
            // this is to make sure that the timer doesn't keep going
            handle.cancel();
View Full Code Here

    @Test (expected=IllegalStateException.class)
        public void startAfterCancelRecurringTask() throws Exception {
        RecurringTaskHandle handle =
            getRecurringTask().getRecurringTaskHandle();
        handle.cancel();
        handle.start();
    }

    /**
     * Add and consume correctness tests.
     */
 
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.