Package org.prevayler.implementation

Examples of org.prevayler.implementation.TransactionTimestamp


      _myTransactionError = (Error) transactionCandidate;
      notifyMyTransactionMonitor();
      return;
    }

    TransactionTimestamp transactionTimestamp = (TransactionTimestamp) transactionCandidate;
    Date timestamp = transactionTimestamp.executionTime();
    long systemVersion = transactionTimestamp.systemVersion();

    _clock.advanceTo(timestamp);

    if (transactionTimestamp.capsule() == null) {
      _subscriber.receive(new TransactionTimestamp(_myCapsule, systemVersion, timestamp));
      notifyMyTransactionMonitor();
      return;
    }

    _subscriber.receive(new TransactionTimestamp(transactionTimestamp.capsule(), systemVersion, timestamp));
  }
View Full Code Here



  public void receive(TransactionTimestamp tt) {

    if (tt.capsule() == _remoteCapsule)
      tt = new TransactionTimestamp(null, tt.systemVersion(), tt.executionTime()); //TODO This is really ugly. It is using a null capsule inside the TransactionTimestamp to signal that the remote Capsule should be executed.

    try {
      synchronized (_remote) {
        _remote.writeObject(tt);
      }
View Full Code Here

  }


  public void run() {
    while (true) {
      TransactionTimestamp notification = waitForNotification();
      _delegate.receive(notification);
    }
  }
View Full Code Here

    notifySubscribers(guide);
  }

  private TransactionGuide guideFor(Capsule capsule) {
    synchronized (_nextTurnMonitor) {
      TransactionTimestamp timestamp = new TransactionTimestamp(capsule, _nextTransaction, _pausableClock.realTime());

      // Count this transaction
      Turn turn = _nextTurn;
      _nextTurn = _nextTurn.next();
      _nextTransaction++;
View Full Code Here

    int i = (int) (initialTransaction - _initialTransaction);
    if (i > journal.size())
      throw new IOException("The transaction journal has not yet reached transaction " + initialTransaction + ". The last logged transaction was " + (_initialTransaction + journal.size() - 1) + ".");

    while (i != journal.size()) {
      TransactionTimestamp entry = (TransactionTimestamp) journal.get(i);
      long recoveringTransaction = _initialTransaction + i;
      if (entry.systemVersion() != recoveringTransaction) {
        throw new IOException("Expected " + recoveringTransaction + " but was " + entry.systemVersion());
      }
      subscriber.receive(entry);
      i++;
    }
  }
View Full Code Here

          if (!journal.getName().endsWith(_journalSuffix)) {
            throw new IOException("There are transactions needing to be recovered from " +
                journal + ", but only " + _journalSuffix + " files are supported");
          }

          TransactionTimestamp entry = TransactionTimestamp.fromChunk(chunk);

          if (entry.systemVersion() != recoveringTransaction) {
            throw new IOException("Expected " + recoveringTransaction + " but was " + entry.systemVersion());
          }

          subscriber.receive(entry);
        }
View Full Code Here

TOP

Related Classes of org.prevayler.implementation.TransactionTimestamp

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.