ehcache

net.sf.ehcache.hibernate.ccs
Class EhcacheReadOnlyCache

java.lang.Object
  extended by net.sf.ehcache.hibernate.ccs.EhcacheReadOnlyCache
All Implemented Interfaces:
org.hibernate.cache.CacheConcurrencyStrategy

Deprecated.

@Deprecated
public class EhcacheReadOnlyCache
extends Object

Ehcache specific read-only cache concurrency strategy.

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

Author:
Chris Dennis

Field Summary
protected  EhCache cache
          Deprecated. Ehcache instance this strategy accesses.
 
Constructor Summary
EhcacheReadOnlyCache()
          Deprecated.  
 
Method Summary
 boolean afterInsert(Object key, Object value, Object version)
          Deprecated. Inserts the specified item into the cache.
 boolean afterUpdate(Object key, Object value, Object version, org.hibernate.cache.access.SoftLock lock)
          Deprecated. Throws UnsupportedOperationException since items in a read-only cache should not be mutated.
 void clear()
          Deprecated. 
 void destroy()
          Deprecated. 
 void evict(Object key)
          Deprecated. A No-Op, since we are an asynchronous cache concurrency strategy.
 Object get(Object key, long timestamp)
          Deprecated. 
 org.hibernate.cache.Cache getCache()
          Deprecated. 
 String getRegionName()
          Deprecated. 
 boolean insert(Object key, Object value, Object currentVersion)
          Deprecated. A No-Op, since we are an asynchronous cache concurrency strategy.
 org.hibernate.cache.access.SoftLock lock(Object key, Object version)
          Deprecated. Throws UnsupportedOperationException since items in a read-only cache should not be mutated.
 boolean put(Object key, Object value, long timestamp, Object version, Comparator versionComparator, boolean minimalPut)
          Deprecated. 
 void release(Object key, org.hibernate.cache.access.SoftLock lock)
          Deprecated. Logs an error since items in a read-only cache should not be mutated.
 void remove(Object key)
          Deprecated. 
 void setCache(org.hibernate.cache.Cache cache)
          Deprecated. 
 String toString()
          Deprecated. 
 boolean update(Object key, Object value, Object currentVersion, Object previousVersion)
          Deprecated. Throws UnsupportedOperationException since items in a read-only cache should not be mutated.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

cache

protected EhCache cache
Deprecated. 
Ehcache instance this strategy accesses.

Constructor Detail

EhcacheReadOnlyCache

public EhcacheReadOnlyCache()
Deprecated. 
Method Detail

get

public Object get(Object key,
                  long timestamp)
           throws org.hibernate.cache.CacheException
Deprecated. 

Throws:
org.hibernate.cache.CacheException

lock

public org.hibernate.cache.access.SoftLock lock(Object key,
                                                Object version)
                                         throws UnsupportedOperationException
Deprecated. 
Throws UnsupportedOperationException since items in a read-only cache should not be mutated.

Throws:
UnsupportedOperationException - always

put

public boolean put(Object key,
                   Object value,
                   long timestamp,
                   Object version,
                   Comparator versionComparator,
                   boolean minimalPut)
            throws org.hibernate.cache.CacheException
Deprecated. 

Throws:
org.hibernate.cache.CacheException

release

public void release(Object key,
                    org.hibernate.cache.access.SoftLock lock)
Deprecated. 
Logs an error since items in a read-only cache should not be mutated.


afterUpdate

public boolean afterUpdate(Object key,
                           Object value,
                           Object version,
                           org.hibernate.cache.access.SoftLock lock)
                    throws UnsupportedOperationException
Deprecated. 
Throws UnsupportedOperationException since items in a read-only cache should not be mutated.

Throws:
UnsupportedOperationException - always

afterInsert

public boolean afterInsert(Object key,
                           Object value,
                           Object version)
                    throws org.hibernate.cache.CacheException
Deprecated. 
Inserts the specified item into the cache.

Throws:
org.hibernate.cache.CacheException

evict

public void evict(Object key)
           throws org.hibernate.cache.CacheException
Deprecated. 
A No-Op, since we are an asynchronous cache concurrency strategy.

Throws:
org.hibernate.cache.CacheException

insert

public boolean insert(Object key,
                      Object value,
                      Object currentVersion)
Deprecated. 
A No-Op, since we are an asynchronous cache concurrency strategy.


update

public boolean update(Object key,
                      Object value,
                      Object currentVersion,
                      Object previousVersion)
               throws UnsupportedOperationException
Deprecated. 
Throws UnsupportedOperationException since items in a read-only cache should not be mutated.

Throws:
UnsupportedOperationException - always

toString

public String toString()
Deprecated. 

Overrides:
toString in class Object

setCache

public final void setCache(org.hibernate.cache.Cache cache)
                    throws org.hibernate.cache.CacheException
Deprecated. 

Specified by:
setCache in interface org.hibernate.cache.CacheConcurrencyStrategy
Throws:
org.hibernate.cache.CacheException - if the underlying cache is not an Ehcache

getCache

public final org.hibernate.cache.Cache getCache()
Deprecated. 

Specified by:
getCache in interface org.hibernate.cache.CacheConcurrencyStrategy

getRegionName

public final String getRegionName()
Deprecated. 

Specified by:
getRegionName in interface org.hibernate.cache.CacheConcurrencyStrategy

remove

public final void remove(Object key)
                  throws org.hibernate.cache.CacheException
Deprecated. 

Specified by:
remove in interface org.hibernate.cache.CacheConcurrencyStrategy
Throws:
org.hibernate.cache.CacheException

clear

public final void clear()
                 throws org.hibernate.cache.CacheException
Deprecated. 

Specified by:
clear in interface org.hibernate.cache.CacheConcurrencyStrategy
Throws:
org.hibernate.cache.CacheException

destroy

public final void destroy()
Deprecated. 

Specified by:
destroy in interface org.hibernate.cache.CacheConcurrencyStrategy

ehcache

Copyright © 2003-2014 Terracotta, Inc.. All Rights Reserved.