org.melati.poem.transaction
Class Transactioned

Package class diagram package Transactioned
java.lang.Object
  extended by org.melati.poem.transaction.Transactioned
Direct Known Subclasses:
JdbcPersistent, TransactionedSerial

public abstract class Transactioned
extends Object

An object which can have uncommitted state within a Transaction.


Field Summary
protected  boolean valid
           
 
Constructor Summary
Transactioned()
          Constructor.
Transactioned(TransactionPool transactionPool)
          Constructor.
 
Method Summary
protected  void commit(Transaction transaction)
           
 void invalidate()
          Mark as invalid.
protected abstract  void load(Transaction transaction)
          Load the transactioned object from its backing store.
 void markValid()
          Mark as valid.
protected  void readLock(Transaction transaction)
           
protected  void reset()
           
protected  void rollback(Transaction transaction)
           
protected  void setTransactionPool(TransactionPool transactionPool)
           
protected  TransactionPool transactionPool()
           
protected  void unSee(Transaction transaction)
           
protected abstract  boolean upToDate(Transaction transaction)
          Whether this instance is up-to-date.
protected abstract  void writeDown(Transaction transaction)
           
protected  void writeLock(Transaction transaction)
          Get a write lock on the given object if we do not already have one.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

valid

protected boolean valid
Constructor Detail

Transactioned

public Transactioned(TransactionPool transactionPool)
Constructor.

Parameters:
transactionPool - the TransactionPool

Transactioned

public Transactioned()
Constructor.

Method Detail

load

protected abstract void load(Transaction transaction)
Load the transactioned object from its backing store.


upToDate

protected abstract boolean upToDate(Transaction transaction)
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.


writeDown

protected abstract void writeDown(Transaction transaction)

reset

protected void reset()

transactionPool

protected final TransactionPool transactionPool()

setTransactionPool

protected void setTransactionPool(TransactionPool transactionPool)

readLock

protected void readLock(Transaction transaction)

writeLock

protected void writeLock(Transaction transaction)
Get a write lock on the given object if we do not already have one.

This will block until no other transactions have write locks on the object before claiming the next write lock. Then it will block until none have read locks.

Finally it calls ensureValid(Transaction).


commit

protected void commit(Transaction transaction)

rollback

protected void rollback(Transaction transaction)

invalidate

public void invalidate()
Mark as invalid.


markValid

public void markValid()
Mark as valid.


unSee

protected void unSee(Transaction transaction)


Copyright © 2000-2010 PanEris. All Rights Reserved.