Package net.jini.core.transaction.server

Examples of net.jini.core.transaction.server.ServerTransaction


   * @param txn
   *            the <code>Txn</code> being recovered.
   */
  void recover(Txn txn) {
    // Try to get the transaction
    ServerTransaction st = null;
    try {
      st = txn.getTransaction(proxyPreparer);
    } catch (Throwable t) {
      // log, but otherwise ignore
      try {
View Full Code Here


  throws TransactionException, RemoteException
    {
  iteratorLogger.entering("OutriggerServerImpl", "contents");

  typeCheck(tmpl);
  ServerTransaction str = serverTransaction(tr);

  Txn txn = enterTxn(tr);

  /* Don't bother if transaction is not active,
   * synchronize so we get the most recent answer,
View Full Code Here

    {
  txnLogger.entering("OutriggerServerImpl", "enterTxn");
  if (baseTr == null)
      return null;

  ServerTransaction tr = serverTransaction(baseTr);
  if (tr.isNested()) {
      final String msg = "subtransactions not supported";
      final CannotNestException cne = new CannotNestException(msg);
      txnLogger.log(Levels.FAILED, msg, cne);
      throw cne;
  }
   

  Txn txn = null;
  try {
      txn = txnTable.get(tr.mgr, tr.id);
  } catch (IOException e) {
  } catch (ClassNotFoundException e) {
  } catch (SecurityException e) {
      /* ignore all of these exceptions. These all indicate
       * that there is at least one broken Txn with the same
       * id as baseTr. Either these Txns are not associated
       * with baseTr, in which case joining baseTr is fine, or
       * one of them is associated with baseTr, in which case
       * baseTr must be not be active (because only inactive
       * Txn objects can be broken) and the join bellow will fail
       */
  }

  /*
   * If we find the txn with the probe, we're all done. Just return.
   * Otherwise, we need to join the transaction. Of course, there
   * is a race condition here. While we are attempting to join,
   * others might be attempting to join also. We are careful
   * to ensure that only one of the racing threads is able to
   * update our internal data structures with our internal
   * representation of this transaction.
   * NB: There are better ways of doing this which could ensure
   *     we never make an unnecessary remote call that we may
   *     want to explore later.
   */
  if (txn == null) {
      final TransactionManager mgr =
    (TransactionManager)
        transactionManagerPreparer.prepareProxy(tr.mgr);
      tr = new ServerTransaction(mgr, tr.id);
      tr.join(participantProxy, crashCount);
      txn = txnTable.put(tr);
        }

        return txn;
    }
View Full Code Here

  typeCheck(rep);
  rep.pickID();

  if (opsLogger.isLoggable(Level.FINER) && (tr != null)) {
      ServerTransaction str = serverTransaction(tr);
      opsLogger.log(Level.FINER, "OutriggerServerImpl: write under " +
                "transaction [mgr:{0} id:{1}]",
    new Object[]{str.mgr, new Long(str.id)});
  }
View Full Code Here

      typeCheck(entries[i]);
      entries[i].pickID();
  }

  if (opsLogger.isLoggable(Level.FINER) && (tr != null)) {
      ServerTransaction str = serverTransaction(tr);
      opsLogger.log(Level.FINER, "OutriggerServerImpl: write<multiple> " +
        "under transaction [mgr:{0} id:{1}]",
    new Object[]{str.mgr, new Long(str.id)});
  }
View Full Code Here

  final long currentOrdinal = operationJournal.currentOrdinal();

  // Register a watcher for this client
  tmpl = setupTmpl(tmpl);

        ServerTransaction str = serverTransaction(tr);
  Txn txn = enterTxn(tr);

  final Uuid cookie = UuidFactory.generate();
  final long eventID = nextID();
  final long now = System.currentTimeMillis();
View Full Code Here

  listener =
      (RemoteEventListener)listenerPreparer.prepareProxy(listener);
  final long currentOrdinal = operationJournal.currentOrdinal();

        ServerTransaction str = serverTransaction(tr);
  Txn txn = enterTxn(tr);

  for (int i=0; i<tmpls.length; i++) {
      typeCheck(tmpls[i]);
  }
View Full Code Here

  }

  checkLimit(limit);
  checkTimeout(timeout);

  ServerTransaction str = serverTransaction(tr);
  Txn txn = enterTxn(tr);

  /* Don't bother if transaction is not active,
   * synchronize so we get the most recent answer,
   * not because we need to make anything atomic.
View Full Code Here

  if (leaseTime < 1 && leaseTime != Lease.ANY) {
      throw logAndThrowIllegalArg(
     "leaseTime = " + leaseTime + ", must be postive or Lease.ANY");
  }

  ServerTransaction str = serverTransaction(tr);
  Txn txn = enterTxn(tr);

  /* Don't bother if transaction is not active,
   * synchronize so we get the most recent answer,
   * not because we need to make anything atomic.
View Full Code Here

  Txn match = null;
  Throwable t = null; // The first throwable we get, if any
  final List fixed = new java.util.LinkedList(); // fixed Txns
  for (int i=0; i<brokenTxnsForId.length; i++) {
      try {
    final ServerTransaction st =
        brokenTxnsForId[i].getTransaction(proxyPreparer);

    /* We fixed a Txn, remember so we can move it
     * to txns.
     */
 
View Full Code Here

TOP

Related Classes of net.jini.core.transaction.server.ServerTransaction

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.