|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.melati.poem.transaction.Transactioned
public abstract class Transactioned
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 |
---|
protected boolean valid
Constructor Detail |
---|
public Transactioned(TransactionPool transactionPool)
transactionPool
- the TransactionPoolpublic Transactioned()
Method Detail |
---|
protected abstract void load(Transaction transaction)
protected abstract boolean upToDate(Transaction transaction)
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.
protected abstract void writeDown(Transaction transaction)
protected void reset()
protected final TransactionPool transactionPool()
protected void setTransactionPool(TransactionPool transactionPool)
protected void readLock(Transaction transaction)
protected void writeLock(Transaction transaction)
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)
.
protected void commit(Transaction transaction)
protected void rollback(Transaction transaction)
public void invalidate()
public void markValid()
protected void unSee(Transaction transaction)
|
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |