Package com.sun.sgs.service

Examples of com.sun.sgs.service.Transaction.join()


            if (logger.isLoggable(Level.FINER)) {
                logger.log(Level.FINER, "join txn:{0}", txn);
            }
            context = contextFactory.createContext(txn);
            currentContext.set(context);
            txn.join(contextFactory.getParticipant());
        } else if (!txn.equals(context.getTransaction())) {
            clearContext();
            throw new IllegalStateException(
                "Wrong transaction: Expected " + context.getTransaction() +
                ", found " + txn);
View Full Code Here


      // buffering
      handler.publish(record);
        } else {
      Queue<LogRecord> records = bufferedRecords.get(txn);
      if (records == null) {
    txn.join(this);
    records = new ArrayDeque<LogRecord>();
    // this code path is guaranteed to be unique by way of
    // the transaction's uniqueness, so we don't need to
    // worry about a race condition with putting the queue
    // into the map
View Full Code Here

      // buffering
      handler.publish(record);
        } else {
      Queue<LogRecord> records = bufferedRecords.get(txn);
      if (records == null) {
    txn.join(this);
    records = new ArrayDeque<LogRecord>();
    // this code path is guaranteed to be unique by way of
    // the transaction's uniqueness, so we don't need to
    // worry about a race condition with putting the queue
    // into the map
View Full Code Here

                            }
                        }
                    }
                    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) {
View Full Code Here

            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

            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

            if (logger.isLoggable(Level.FINER)) {
                logger.log(Level.FINER, "join txn:{0}", txn);
            }
            context = contextFactory.createContext(txn);
            currentContext.set(context);
            txn.join(contextFactory.getParticipant());
        } else if (!txn.equals(context.getTransaction())) {
            clearContext();
            throw new IllegalStateException(
                "Wrong transaction: Expected " + context.getTransaction() +
                ", found " + txn);
View Full Code Here

                            }
                        }
                    }
                    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) {
View Full Code Here

            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

            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

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.