edu.stanford.smi.protege.util.transaction
Class TransactionCache<V,R>
java.lang.Object
edu.stanford.smi.protege.util.transaction.TransactionCache<V,R>
- Type Parameters:
V
- R
-
- Direct Known Subclasses:
- TransactionCacheImpl
public abstract class TransactionCache<V,R>
- extends Object
This class manages caches in the presence of transactions. Transactions significantly
complicate cache processing and it is very difficult to impossible to predict exactly what
scheduling decisions the database will make when transactions are on.
- Author:
- tredmond
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
TransactionCache
public TransactionCache(Cache<V,R> storage)
isCached
public boolean isCached(V var)
read
public R read(V var)
valueFromStore
public void valueFromStore(V var,
R result)
write
public void write(V var,
R result)
- This method is called when the caller does an operation that changes
the value of var to result. There is a completeness requirement on the
caller - any time a var is changed the caller must call either write or
invalidate.
- Parameters:
var
- the variable that was modified.result
- the value that the variable was changed to.
invalidate
public void invalidate(V var)
- This call is made when the caller changes the variable but the caller is not
sure what value the caller set. There is a completeness requirement on the
caller - any time a var is changed the caller must call either write or
invalidate.
- Parameters:
var
- the variable being updated.
commitTransaction
public void commitTransaction()
rollbackTransaction
public void rollbackTransaction()
inTransaction
public abstract boolean inTransaction()
getTransactionIsolationLevel
public abstract TransactionIsolationLevel getTransactionIsolationLevel()
isDisabled
public abstract boolean isDisabled()
createSessionCache
public abstract LosslessCache<V,R> createSessionCache(RemoteSession session)
Submit a bug report or feature request
Protégé is a trademark of Stanford University.
Copyright (c) 1998-2007 Stanford University.