org.melati.poem.transaction
Class TransactionedSerial

Package class diagram package TransactionedSerial
java.lang.Object
  extended by org.melati.poem.transaction.Transactioned
      extended by org.melati.poem.transaction.TransactionedSerial

public class TransactionedSerial
extends Transactioned

A serial id of an object which is incremented each time that object is loaded or locked.


Field Summary
 
Fields inherited from class org.melati.poem.transaction.Transactioned
valid
 
Constructor Summary
TransactionedSerial(TransactionPool transactionPool)
          Constructor.
 
Method Summary
 long current(Transaction transaction)
          Readlock and return the serial for the given Transaction.
 void increment_unlocked()
          Increment.
 void increment(Transaction transaction)
          Write lock and increment.
protected  void load(Transaction transaction)
          On load increment the Serial for this object.
protected  boolean upToDate(Transaction transaction)
          Return the inheritted validity flag.
protected  void writeDown(Transaction transaction)
          This implementation does nothing.
 
Methods inherited from class org.melati.poem.transaction.Transactioned
commit, invalidate, markValid, readLock, reset, rollback, setTransactionPool, transactionPool, unSee, writeLock
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TransactionedSerial

public TransactionedSerial(TransactionPool transactionPool)
Constructor.

Parameters:
transactionPool - the TransactionPool this is relevant to
Method Detail

load

protected void load(Transaction transaction)
On load increment the Serial for this object. Load the transactioned object from its backing store.

Specified by:
load in class Transactioned
See Also:
Transactioned.load(org.melati.poem.transaction.Transaction)

upToDate

protected boolean upToDate(Transaction transaction)
Return the inheritted validity flag. Whether this instance is up-to-date.

This is a hook to enable subtypes to define under what circumstances an instance needs to be reloaded when it is marked as invalid, however the two known subtypes just return the inherited valid flag.

Specified by:
upToDate in class Transactioned
See Also:
Transactioned.upToDate(org.melati.poem.transaction.Transaction)

writeDown

protected void writeDown(Transaction transaction)
This implementation does nothing.

Specified by:
writeDown in class Transactioned
See Also:
Transactioned.writeDown(org.melati.poem.transaction.Transaction)

current

public long current(Transaction transaction)
Readlock and return the serial for the given Transaction.

Parameters:
transaction - the Transaction
Returns:
the serial for the given Transaction

increment

public void increment(Transaction transaction)
Write lock and increment.

Parameters:
transaction - the Transaction

increment_unlocked

public void increment_unlocked()
Increment.



Copyright © 2000-2010 PanEris. All Rights Reserved.