Package com.sun.sgs.service

Examples of com.sun.sgs.service.Transaction


                super.run();
                action1 = new ShutdownServiceAction(service);
                action1.assertBlocked();
                action2 = new ShutdownServiceAction(service);
                action2.assertBlocked();
                Transaction txn = txnProxy.getCurrentTransaction();
                txn.abort(new TestAbortedTransactionException("abort"));
            }
        }

        try {
            TestTask task = new TestTask();
View Full Code Here


        txnScheduler.runTask(new InitialTestRunnable(), taskOwner);
        // We use dummy outside of the transaction - it is transient here.
        txnScheduler.runTask(new TestAbstractKernelRunnable() {
            public void run() {
                service.removeObject(dummy);
                Transaction txn = txnProxy.getCurrentTransaction();
                txn.abort(new TestAbortedTransactionException("abort"));
        }}, taskOwner);
    }
View Full Code Here

        txnScheduler.runTask(new InitialTestRunnable(), taskOwner);
        try {
            txnScheduler.runTask(new TestAbstractKernelRunnable() {
                public void run() {
                    service.getBinding("dummy");
                    Transaction txn = txnProxy.getCurrentTransaction();
                    txn.abort(new TestAbortedTransactionException("abort"));
            }}, taskOwner);
        } catch (TestAbortedTransactionException e) {
            System.err.println(e);
        }
        txnScheduler.runTask(new TestAbstractKernelRunnable() {
View Full Code Here

    /**
     * Checks that the specified context is currently active, throwing
     * TransactionNotActiveException if it isn't.
     */
    static void checkTransaction(Transaction txn) {
  Transaction currentTxn = txnProxy.getCurrentTransaction();
  if (currentTxn != txn) {
      throw new TransactionNotActiveException(
     "mismatched transaction; expected " + currentTxn + ", got " +
    txn);
  }
View Full Code Here

                                throw e;
                            }
                        }
                    }
                    Participant participant = new Participant();
                    Transaction txn = txnProxy.getCurrentTransaction();
                    txn.join(participant);
                    txn.abort(new TestAbortedTransactionException("abort"));
                    assertTrue("Action should throw", participant.ok);
            }}, taskOwner);

        } catch (TestAbortedTransactionException e) {
            System.err.println(e);
View Full Code Here

        try {
            txnScheduler.runTask(new InitialTestRunnable() {
                public void run() throws Exception {
                    super.run();
                    action.setUp();
                    Transaction txn = txnProxy.getCurrentTransaction();
                    txn.abort(new TestAbortedTransactionException("abort"));
                    try {
                        action.run();
                        fail("Expected TransactionNotActiveException");
                    } catch (TransactionNotActiveException e) {
                        System.err.println(e);
View Full Code Here

        try {
            txnScheduler.runTask(new InitialTestRunnable() {
                public void run() throws Exception {
                    super.run();
                    action.setUp();
                    Transaction txn = txnProxy.getCurrentTransaction();
                    txn.join(participant);
                }}, taskOwner);
        } catch (TransactionNotActiveException e) {
            System.err.println(e);
        }
        assertTrue("Action should throw", participant.ok);
View Full Code Here

        try {
            txnScheduler.runTask(new InitialTestRunnable() {
                public void run() throws Exception {
                    super.run();
                    action.setUp();
                    Transaction txn = txnProxy.getCurrentTransaction();
                    txn.join(participant);
            }}, taskOwner);
        catch (TransactionNotActiveException e) {
            System.err.println(e);
        }
  assertTrue("Action should throw", participant.ok);
View Full Code Here

        try {
            txnScheduler.runTask(new InitialTestRunnable() {
                public void run() throws Exception {
                    super.run();
                    action.setUp();
                    Transaction txn = txnProxy.getCurrentTransaction();
                    txn.abort(new TestAbortedTransactionException("abort"));
            }}, taskOwner);
        } catch (TestAbortedTransactionException e) {
            System.err.println(" Transaction aborted: " + e);
        }
View Full Code Here

                action2 = new ShutdownServiceAction(service);
                action2.assertBlocked();
                action1.interrupt(); // shutdown should not unblock
                action1.assertBlocked();
                action2.assertBlocked();
                Transaction txn = txnProxy.getCurrentTransaction();
                txn.abort(new TestAbortedTransactionException("abort"));
            }
View Full Code Here

TOP

Related Classes of com.sun.sgs.service.Transaction

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.