com.hazelcast.hibernate.region
Class AbstractGeneralRegion

java.lang.Object
  extended by com.hazelcast.hibernate.region.AbstractGeneralRegion
All Implemented Interfaces:
HazelcastRegion, org.hibernate.cache.GeneralDataRegion, org.hibernate.cache.Region
Direct Known Subclasses:
HazelcastQueryResultsRegion, HazelcastTimestampsRegion

public abstract class AbstractGeneralRegion
extends Object
implements org.hibernate.cache.GeneralDataRegion

Author:
Leo Kim (lkim@limewire.com)

Constructor Summary
protected AbstractGeneralRegion(HazelcastInstance instance, String name)
           
 
Method Summary
 boolean contains(Object key)
           
 void destroy()
           
 void evict(Object key)
           
 void evictAll()
           
 Object get(Object key)
           
 IMap getCache()
           
 long getElementCountInMemory()
           
 long getElementCountOnDisk()
          Hazelcast does not support pushing elements to disk.
 String getName()
           
 long getSizeInMemory()
           
 int getTimeout()
           
 long nextTimestamp()
           
 void put(Object key, Object value)
           
 Map toMap()
          Appears to be used only by org.hibernate.stat.SecondLevelCacheStatistics.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.hibernate.cache.Region
contains, destroy, getElementCountInMemory, getElementCountOnDisk, getName, getSizeInMemory, getTimeout, nextTimestamp, toMap
 

Constructor Detail

AbstractGeneralRegion

protected AbstractGeneralRegion(HazelcastInstance instance,
                                String name)
Method Detail

evict

public void evict(Object key)
           throws org.hibernate.cache.CacheException
Specified by:
evict in interface org.hibernate.cache.GeneralDataRegion
Throws:
org.hibernate.cache.CacheException

evictAll

public void evictAll()
              throws org.hibernate.cache.CacheException
Specified by:
evictAll in interface org.hibernate.cache.GeneralDataRegion
Throws:
org.hibernate.cache.CacheException

get

public Object get(Object key)
           throws org.hibernate.cache.CacheException
Specified by:
get in interface org.hibernate.cache.GeneralDataRegion
Throws:
org.hibernate.cache.CacheException

put

public void put(Object key,
                Object value)
         throws org.hibernate.cache.CacheException
Specified by:
put in interface org.hibernate.cache.GeneralDataRegion
Throws:
org.hibernate.cache.CacheException

getCache

public final IMap getCache()
Specified by:
getCache in interface HazelcastRegion

destroy

public void destroy()
             throws org.hibernate.cache.CacheException
Specified by:
destroy in interface org.hibernate.cache.Region
Throws:
org.hibernate.cache.CacheException

getElementCountInMemory

public long getElementCountInMemory()
Specified by:
getElementCountInMemory in interface org.hibernate.cache.Region
Returns:
The size of the internal IMap.

getElementCountOnDisk

public long getElementCountOnDisk()
Hazelcast does not support pushing elements to disk.

Specified by:
getElementCountOnDisk in interface org.hibernate.cache.Region
Returns:
-1 this value means "unsupported"

getName

public String getName()
Specified by:
getName in interface org.hibernate.cache.Region
Returns:
The name of the region.

getSizeInMemory

public long getSizeInMemory()
Specified by:
getSizeInMemory in interface org.hibernate.cache.Region
Returns:
a rough estimate of number of bytes used by this region.

getTimeout

public int getTimeout()
Specified by:
getTimeout in interface org.hibernate.cache.Region

nextTimestamp

public long nextTimestamp()
Specified by:
nextTimestamp in interface org.hibernate.cache.Region

toMap

public Map toMap()
Appears to be used only by org.hibernate.stat.SecondLevelCacheStatistics.

Specified by:
toMap in interface org.hibernate.cache.Region
Returns:
the internal IMap used for this region.

contains

public boolean contains(Object key)
Specified by:
contains in interface org.hibernate.cache.Region


Copyright © 2011 Hazel Bilisim Ltd.. All Rights Reserved.