|
Protege 3.4.5 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectedu.stanford.smi.protege.util.transaction.cache.impl.ReadCommittedCache<S,V,R>
public class ReadCommittedCache<S,V,R>
Field Summary | |
---|---|
static Logger |
LOGGER
|
Constructor Summary | |
---|---|
ReadCommittedCache(Cache<S,V,R> delegate)
|
Method Summary | |
---|---|
void |
abortCompleteCache()
|
void |
beginTransaction(S session)
The session has entered a transaction. |
void |
commitTransaction(S session)
A transaction is committed. |
void |
finishCompleteCache()
The startCompleteCache and the finishCompleteCache are part of a protocol. |
void |
flush()
Try to avoid this. |
int |
getCacheId()
This method returns a unique id for each cache. |
int |
getTransactionNesting(S session)
Returns the transaction nesting for a session. |
void |
invalidate(S session)
This notifies the cache that this cache is now invalid either because the object that this cache represents is deleted or for any other reason. |
boolean |
isCacheComplete()
|
boolean |
isInvalid()
This indicates that the cache has entered the deleted state or is otherwise invalid. |
void |
modifyCache(S session,
V var)
This notifies the cache, that the caller has made a change to the value of the var. |
void |
modifyCache(S session,
V var,
R value)
This notifies the cache that the caller has made a change to the value of var and that the caller knows the new value is value. |
CacheResult<R> |
readCache(S session,
V var)
If the variable var is cached then this returns the cached value. |
void |
rollbackTransaction(S session)
A transaction is rolled back. |
void |
startCompleteCache()
The startCompleteCache and the finishCompleteCache are part of a protocol. |
void |
updateCache(S session,
V var)
This call indicates that a read was scheduled but no useful value was retrieved. |
void |
updateCache(S session,
V var,
R value)
The caller has received an update that the new value of var is value. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final Logger LOGGER
Constructor Detail |
---|
public ReadCommittedCache(Cache<S,V,R> delegate)
Method Detail |
---|
public CacheResult<R> readCache(S session, V var)
Cache
CacheResult result = cache.readCache(session, var); if (result.isValid()) { return result.getValue(); else { go to the source to find the right value }works and is the recommended approach.
readCache
in interface Cache<S,V,R>
var
- a variable
public void updateCache(S session, V var)
Cache
updateCache
in interface Cache<S,V,R>
session
- the session making the changepublic void updateCache(S session, V var, R value)
Cache
updateCache
in interface Cache<S,V,R>
session
- the session making the changepublic void modifyCache(S session, V var)
Cache
modifyCache
in interface Cache<S,V,R>
session
- the session making the changevar
- the variable being modified.public void modifyCache(S session, V var, R value)
Cache
modifyCache
in interface Cache<S,V,R>
session
- the session making the changevar
- the variable being changedvalue
- the new value for the variablepublic void invalidate(S session)
Cache
invalidate
in interface Cache<S,V,R>
public boolean isInvalid()
Cache
isInvalid
in interface Cache<S,V,R>
public void startCompleteCache()
Cache
startCompleteCache
in interface Cache<S,V,R>
public void finishCompleteCache()
Cache
finishCompleteCache
in interface Cache<S,V,R>
public void abortCompleteCache()
abortCompleteCache
in interface Cache<S,V,R>
public boolean isCacheComplete()
isCacheComplete
in interface Cache<S,V,R>
public void beginTransaction(S session)
Cache
beginTransaction
in interface Cache<S,V,R>
public void commitTransaction(S session)
Cache
commitTransaction
in interface Cache<S,V,R>
public void rollbackTransaction(S session)
Cache
rollbackTransaction
in interface Cache<S,V,R>
public int getTransactionNesting(S session)
Cache
getTransactionNesting
in interface Cache<S,V,R>
public void flush()
Cache
flush
in interface Cache<S,V,R>
public int getCacheId()
Cache
getCacheId
in interface Cache<S,V,R>
|
Protege 3.4.5 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |