Examples of KernelRunnable


Examples of com.sun.sgs.kernel.KernelRunnable

            }, taskOwner);
    }

    @Test public void runTransactionInTransaction() throws Exception {
        final TransactionProxy proxy = serverNode.getProxy();
        KernelRunnable task = new TestAbstractKernelRunnable() {
                public void run() throws Exception {
                    final Transaction t = proxy.getCurrentTransaction();
                    txnScheduler.runTask(new TestAbstractKernelRunnable() {
                            public void run() throws Exception {
                                Transaction t2 = proxy.getCurrentTransaction();
View Full Code Here

Examples of com.sun.sgs.kernel.KernelRunnable

        txnScheduler.runTask(task, taskOwner);
    }

    @Test public void runTransactionFromScheduledTask() throws Exception {
        final RunCountTestRunner countRunner = new RunCountTestRunner(1);
        KernelRunnable task = new TestAbstractKernelRunnable() {
                public void run() throws Exception {
                    txnScheduler.runTask(countRunner, taskOwner);
                }
            };
        txnScheduler.scheduleTask(task, taskOwner);
View Full Code Here

Examples of com.sun.sgs.kernel.KernelRunnable

    @Test public void scheduleTransactionRetryAfterInterrupt()
        throws Exception
    {
        final AtomicInteger i = new AtomicInteger(0);
        final KernelRunnable r = new TestAbstractKernelRunnable() {
                public void run() throws Exception {
                    if (i.getAndIncrement() == 0)
                        throw new InterruptedException("test");
                }
            };
View Full Code Here

Examples of com.sun.sgs.kernel.KernelRunnable

        assertEquals(i.get(), 2);
    }

    @Test public void runTransactionInterrupted() throws Exception {
        final AtomicInteger i = new AtomicInteger(0);
        final KernelRunnable r = new TestAbstractKernelRunnable() {
                public void run() throws Exception {
                    if (i.getAndIncrement() == 0)
                        throw new InterruptedException("test");
                }
            };
View Full Code Here

Examples of com.sun.sgs.kernel.KernelRunnable

    @Test public void dropFailedTask() throws Exception {
        final Exception result = new Exception("task failed");
        replaceRetryPolicy(createRetryPolicy(SchedulerRetryAction.DROP));
        final AtomicInteger i = new AtomicInteger(0);
        final KernelRunnable r = new TestAbstractKernelRunnable() {
            public void run() throws Exception {
                if (i.getAndIncrement() == 0)
                    throw result;
            }
        };
View Full Code Here

Examples of com.sun.sgs.kernel.KernelRunnable

    @Test public void retryFailedTask() throws Exception {
        final Exception result = new Exception("task failed");
        replaceRetryPolicy(createRetryPolicy(SchedulerRetryAction.RETRY_NOW));
        final AtomicInteger i = new AtomicInteger(0);
        final KernelRunnable r = new TestAbstractKernelRunnable() {
            public void run() throws Exception {
                if (i.getAndIncrement() == 0)
                    throw result;
            }
        };
View Full Code Here

Examples of com.sun.sgs.kernel.KernelRunnable

    @Test public void handoffFailedTask() throws Exception {
        final Exception result = new Exception("task failed");
        replaceRetryPolicy(createRetryPolicy(SchedulerRetryAction.RETRY_LATER));
        final AtomicInteger i = new AtomicInteger(0);
        final KernelRunnable r = new TestAbstractKernelRunnable() {
            public void run() throws Exception {
                if (i.getAndIncrement() == 0)
                    throw result;
            }
        };
View Full Code Here

Examples of com.sun.sgs.kernel.KernelRunnable

    @Test
    public void testScheduleNonDurableTaskNegativeTime() throws Exception {
        txnScheduler.runTask(
            new TestAbstractKernelRunnable() {
                public void run() {
                    KernelRunnable r = new DummyKernelRunnable();
                    try {
                        taskService.scheduleNonDurableTask(r, -1L, false);
                        fail("Expected IllegalArgumentException");
                    } catch (IllegalArgumentException e) {
                        System.err.println(e);
View Full Code Here

Examples of com.sun.sgs.kernel.KernelRunnable

    @Test
    public void testRunImmediateNonDurableTasks() throws Exception {
        final CountDownLatch latch = new CountDownLatch(3);
        txnScheduler.runTask(new TestAbstractKernelRunnable() {
                public void run() throws Exception {
                    KernelRunnable r = new TestAbstractKernelRunnable() {
                            public void run() throws Exception {
                                if (! txnProxy.getCurrentOwner().
                                    equals(taskOwner)) {
                                    throw new RuntimeException("New identity");
                                }
View Full Code Here

Examples of com.sun.sgs.kernel.KernelRunnable

    @Test
    public void testRunPendingNonDurableTasks() throws Exception {
        final CountDownLatch latch = new CountDownLatch(3);
        txnScheduler.runTask(new TestAbstractKernelRunnable() {
                public void run() throws Exception {
                    KernelRunnable r = new TestAbstractKernelRunnable() {
                            public void run() throws Exception {
                                if (! txnProxy.getCurrentOwner().
                                    equals(taskOwner)) {
                                    throw new RuntimeException("New identity");
                                }
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.