|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.hibernate.cache.TransactionalCache
public class TransactionalCache
Support for fully transactional cache implementations like JBoss TreeCache. Note that this might be a less scalable concurrency strategy than ReadWriteCache. This is a "synchronous" concurrency strategy.
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from interface org.hibernate.cache.CacheConcurrencyStrategy |
|---|
CacheConcurrencyStrategy.SoftLock |
| Constructor Summary | |
|---|---|
TransactionalCache()
|
|
| Method Summary | |
|---|---|
boolean |
afterInsert(Object key,
Object value,
Object version)
Do nothing. |
boolean |
afterUpdate(Object key,
Object value,
Object version,
CacheConcurrencyStrategy.SoftLock clientLock)
Do nothing. |
void |
clear()
Evict all items from the cache immediately. |
void |
destroy()
Clean up all resources. |
void |
evict(Object key)
Called after an item has become stale (before the transaction completes). |
Object |
get(Object key,
long txTimestamp)
Attempt to retrieve an object from the cache. |
Cache |
getCache()
Get the wrapped cache implementation |
String |
getRegionName()
Get the cache region name |
boolean |
insert(Object key,
Object value,
Object currentVersion)
Called after an item has been inserted (before the transaction completes), instead of calling evict(). |
CacheConcurrencyStrategy.SoftLock |
lock(Object key,
Object version)
Do nothing, returning null. |
boolean |
put(Object key,
Object value,
long txTimestamp,
Object version,
Comparator versionComparator,
boolean minimalPut)
Attempt to cache an object, after loading from the database. |
void |
release(Object key,
CacheConcurrencyStrategy.SoftLock clientLock)
Do nothing. |
void |
remove(Object key)
Evict an item from the cache immediately (without regard for transaction isolation). |
void |
setCache(Cache cache)
Set the underlying cache implementation. |
String |
toString()
|
boolean |
update(Object key,
Object value,
Object currentVersion,
Object previousVersion)
Called after an item has been updated (before the transaction completes), instead of calling evict(). |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public TransactionalCache()
| Method Detail |
|---|
public String getRegionName()
CacheConcurrencyStrategy
getRegionName in interface CacheConcurrencyStrategy
public Object get(Object key,
long txTimestamp)
throws CacheException
CacheConcurrencyStrategy
get in interface CacheConcurrencyStrategytxTimestamp - a timestamp prior to the transaction start time
CacheException
public boolean put(Object key,
Object value,
long txTimestamp,
Object version,
Comparator versionComparator,
boolean minimalPut)
throws CacheException
CacheConcurrencyStrategy
put in interface CacheConcurrencyStrategytxTimestamp - a timestamp prior to the transaction start timeversion - the item version numberversionComparator - a comparator used to compare version numbersminimalPut - indicates that the cache should avoid a put is the item is already cached
CacheException
public CacheConcurrencyStrategy.SoftLock lock(Object key,
Object version)
throws CacheException
lock in interface CacheConcurrencyStrategyCacheException
public void release(Object key,
CacheConcurrencyStrategy.SoftLock clientLock)
throws CacheException
release in interface CacheConcurrencyStrategyCacheException
public boolean update(Object key,
Object value,
Object currentVersion,
Object previousVersion)
throws CacheException
CacheConcurrencyStrategy
update in interface CacheConcurrencyStrategyCacheException
public boolean insert(Object key,
Object value,
Object currentVersion)
throws CacheException
CacheConcurrencyStrategy
insert in interface CacheConcurrencyStrategyCacheException
public void evict(Object key)
throws CacheException
CacheConcurrencyStrategy
evict in interface CacheConcurrencyStrategyCacheException
public void remove(Object key)
throws CacheException
CacheConcurrencyStrategy
remove in interface CacheConcurrencyStrategyCacheException
public void clear()
throws CacheException
CacheConcurrencyStrategy
clear in interface CacheConcurrencyStrategyCacheExceptionpublic void destroy()
CacheConcurrencyStrategy
destroy in interface CacheConcurrencyStrategypublic void setCache(Cache cache)
CacheConcurrencyStrategy
setCache in interface CacheConcurrencyStrategypublic Cache getCache()
CacheConcurrencyStrategy
getCache in interface CacheConcurrencyStrategy
public boolean afterInsert(Object key,
Object value,
Object version)
throws CacheException
afterInsert in interface CacheConcurrencyStrategyCacheException
public boolean afterUpdate(Object key,
Object value,
Object version,
CacheConcurrencyStrategy.SoftLock clientLock)
throws CacheException
afterUpdate in interface CacheConcurrencyStrategyCacheExceptionpublic String toString()
toString in class Object
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||