001
014
015 package com.liferay.portal.dao.orm.hibernate.region;
016
017 import net.sf.ehcache.hibernate.regions.EhcacheTimestampsRegion;
018
019 import org.hibernate.cache.CacheException;
020 import org.hibernate.cache.TimestampsRegion;
021
022
025 public class TimestampsRegionWrapper
026 extends BaseRegionWrapper implements TimestampsRegion {
027
028 public TimestampsRegionWrapper(
029 EhcacheTimestampsRegion ehcacheTimestampsRegion) {
030
031 super(ehcacheTimestampsRegion);
032 }
033
034 @Override
035 public void evict(Object key) throws CacheException {
036 EhcacheTimestampsRegion ehcacheTimestampsRegion =
037 getEhcacheTimestampsRegion();
038
039 ehcacheTimestampsRegion.evict(key);
040 }
041
042 @Override
043 public void evictAll() throws CacheException {
044 EhcacheTimestampsRegion ehcacheTimestampsRegion =
045 getEhcacheTimestampsRegion();
046
047 ehcacheTimestampsRegion.evictAll();
048 }
049
050 @Override
051 public Object get(Object key) throws CacheException {
052 EhcacheTimestampsRegion ehcacheTimestampsRegion =
053 getEhcacheTimestampsRegion();
054
055 return ehcacheTimestampsRegion.get(key);
056 }
057
058 @Override
059 public void invalidate() {
060 EhcacheTimestampsRegion ehcacheTimestampsRegion =
061 getEhcacheTimestampsRegion();
062
063 ehcacheTimestampsRegion.evictAll();
064 }
065
066 @Override
067 public void put(Object key, Object value) throws CacheException {
068 EhcacheTimestampsRegion ehcacheTimestampsRegion =
069 getEhcacheTimestampsRegion();
070
071 ehcacheTimestampsRegion.put(key, value);
072 }
073
074 protected EhcacheTimestampsRegion getEhcacheTimestampsRegion() {
075 return (EhcacheTimestampsRegion)getEhcacheDataRegion();
076 }
077
078 }