Top Description Fields Constructors Methods
net.sf.ehcache.hibernate.ccs

public Class EhcacheNonstrictReadWriteCache

extends AbstractEhcacheConcurrencyStrategy
Class Inheritance
Annotations
@Deprecated
Imports
java.util.Comparator, org.hibernate.cache.CacheException, org.hibernate.cache.access.SoftLock, org.slf4j.Logger, .LoggerFactory

Deprecated

Ehcache specific non-strict read/write cache concurrency strategy.

This is the Ehcache specific equivalent to Hibernate's NonstrictReadWriteCache.

Author
Chris Dennis

Field Summary

Modifier and TypeField and Description
private static final Logger
Inherited from net.sf.ehcache.hibernate.ccs.AbstractEhcacheConcurrencyStrategy:
cache

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public boolean
public boolean
afterUpdate(Object key, Object value, Object version, SoftLock lock)

Implements org.hibernate.cache.CacheConcurrencyStrategy.afterUpdate.

Removes the invalidated item.
public void
evict(Object key)

Implements org.hibernate.cache.CacheConcurrencyStrategy.evict.

Removes the stale item.
public Object
get(Object key, long
a timestamp prior to the transaction start time
txTimestamp
)

Implements org.hibernate.cache.CacheConcurrencyStrategy.get.

Attempt to retrieve an object from the cache.
public boolean
insert(Object key, Object value, Object currentVersion)

Implements org.hibernate.cache.CacheConcurrencyStrategy.insert.

A No-Op, since we are an asynchronous cache concurrency strategy.
public SoftLock
lock(Object key, Object version)

Implements org.hibernate.cache.CacheConcurrencyStrategy.lock.

Caching is non-strict so soft locks are not implemented.
public boolean
put(Object key, Object value, long
a timestamp prior to the transaction start time
txTimestamp
,
Object
the item version number
version
,
Comparator<T>
a comparator used to compare version numbers
versionComparator
,
boolean
indicates that the cache should avoid a put is the item is already cached
minimalPut
)

Implements org.hibernate.cache.CacheConcurrencyStrategy.put.

Attempt to cache an object, after loading from the database.
public void
release(Object key, SoftLock lock)

Implements org.hibernate.cache.CacheConcurrencyStrategy.release.

Removes the invalidated item.
public String
toString()

Overrides java.lang.Object.toString.

Returns a string representation of the object.
public boolean
update(Object key, Object value, Object currentVersion, Object previousVersion)

Implements org.hibernate.cache.CacheConcurrencyStrategy.update.

Removes the invalidated item.
Inherited from net.sf.ehcache.hibernate.ccs.AbstractEhcacheConcurrencyStrategy:
cleardestroygetCachegetRegionNameremovesetCache

Field Detail

LOGback to summary
private static final Logger LOG

Hides net.sf.ehcache.hibernate.ccs.AbstractEhcacheConcurrencyStrategy.LOG.

Constructor Detail

EhcacheNonstrictReadWriteCacheback to summary
public EhcacheNonstrictReadWriteCache()

Method Detail

afterInsertback to summary
public boolean afterInsert(Object key, Object value, Object version) throws CacheException

Implements org.hibernate.cache.CacheConcurrencyStrategy.afterInsert.

A No-Op.

afterUpdateback to summary
public boolean afterUpdate(Object key, Object value, Object version, SoftLock lock) throws CacheException

Implements org.hibernate.cache.CacheConcurrencyStrategy.afterUpdate.

Removes the invalidated item.

evictback to summary
public void evict(Object key) throws CacheException

Implements org.hibernate.cache.CacheConcurrencyStrategy.evict.

Removes the stale item.

getback to summary
public Object get(Object key, long txTimestamp) throws CacheException

Implements org.hibernate.cache.CacheConcurrencyStrategy.get.

Doc from org.hibernate.cache.CacheConcurrencyStrategy.get.

Attempt to retrieve an object from the cache. Mainly used in attempting to resolve entities/collections from the second level cache.

Parameters
txTimestamp:long

a timestamp prior to the transaction start time

Returns:Object

the cached object or null

insertback to summary
public boolean insert(Object key, Object value, Object currentVersion) throws CacheException

Implements org.hibernate.cache.CacheConcurrencyStrategy.insert.

A No-Op, since we are an asynchronous cache concurrency strategy.

lockback to summary
public SoftLock lock(Object key, Object version) throws CacheException

Implements org.hibernate.cache.CacheConcurrencyStrategy.lock.

Caching is non-strict so soft locks are not implemented.

putback to summary
public boolean put(Object key, Object value, long txTimestamp, Object version, Comparator<T> versionComparator, boolean minimalPut) throws CacheException

Implements org.hibernate.cache.CacheConcurrencyStrategy.put.

Doc from org.hibernate.cache.CacheConcurrencyStrategy.put.

Attempt to cache an object, after loading from the database.

Parameters
txTimestamp:long

a timestamp prior to the transaction start time

version:Object

the item version number

versionComparator:Comparator<T>

a comparator used to compare version numbers

minimalPut:boolean

indicates that the cache should avoid a put is the item is already cached

Returns:boolean

true if the object was successfully cached

releaseback to summary
public void release(Object key, SoftLock lock) throws CacheException

Implements org.hibernate.cache.CacheConcurrencyStrategy.release.

Removes the invalidated item.

toStringback to summary
public String toString()

Overrides java.lang.Object.toString.

Doc from java.lang.Object.toString.

Returns a string representation of the object.

Returns:String

a string representation of the object.

Annotations
@Override
updateback to summary
public boolean update(Object key, Object value, Object currentVersion, Object previousVersion) throws CacheException

Implements org.hibernate.cache.CacheConcurrencyStrategy.update.

Removes the invalidated item.